0

I'm using libssh to log into a terminal and then run a ncurses application.

I'm following this tutorial, sending one character at the time: http://api.libssh.org/master/libssh_tutor_shell.html

The ncurses application waits for user input with getstr(), my problem is that when I write the input and press enter libssh sends '\n' rather than an enter signal, so the curses application crashes.

Hohenheimsenberg
  • 935
  • 10
  • 25

1 Answers1

0

You should use here document bash syntax. Your command which you send over libssh API will look something like this:

your_instruction <<tag\ntag

Study the following examples.

Vitaly Isaev
  • 5,392
  • 6
  • 45
  • 64