From: Andrew B. <b3...@gm...> - 2012-02-22 16:05:42
|
Hello, I sometimes run Gtk-Gnutella as a headless daemon and talk to it using the local shell compiled with: cc -o /usr/bin/gtkg-shell -DLOCAL_SHELL_STANDALONE src/core/local_shell.c That works well enough, however, it does not have any command history if I press the up arrow on my keyboard. Reading through local_shell.c I noticed: #ifdef USE_READLINE #include <readline/readline.h> #include <readline/history.h> #endif So I recompiled gtkg-shell with: cc -o /usr/bin/gtkg-shell -DLOCAL_SHELL_STANDALONE \ -DUSE_READLINE -lreadline -lncursesw src/core/local_shell.c However, that wouldn't work, it gave me an error as though gtk-gnutella-headless wasn't running, even though I could see it was running in ps aux. So I recompiled gtk-gnutella-headless with: ./build.sh --topless --libs="-lreadline -lncursesw -lz -lm" \ --cppflags="-DUSE_READLINE" (-lz -lm were needed to avoid linker errors) and that is a bit better, I can: echo status | gtkg-shell and I get a response, however, if I just run gtkg-shell directly it is unresponsive to commands, I have to press ctrl-c to get back to bash. So I've gone round a few circles but I'm no nearer to using readline to get some history in gtkg-shell. Can anyone suggest where I'm going wrong? Andy |