Closed vin-d closed 4 years ago
Hello vin-d,
Although it is possible to keep the previous screen with ncurses using the newterm() init function instead of initscr(), ncurses is intentionally designed to take over the whole screen, and not to just provide bindings to command line apps.
What you are looking for is not ncurses/croatoan, but packages like linedit and cl-readline, which do not provide full-screen access, but just a command line.
Having said that, in your other questions, (format t "xyz") prints to the standard output, which is the repl in your terminal and not the ncurses screen. You either have to bind standard-output to the initialized scr, or use scr as the output stream in format: (format scr "xyz").
In order to be able to use the arrow keys, you have to similarly read the char from scr, not from the terminal standard input.
Thank you for the response, indeed linedit and cl-readline look more appropriate for the CLI I want to build.
Hi, I'd like to build a small CLI using croatoan with sbcl and would need a bit of help to know how to achieve that. my running environment is Debian and bash terminal
Goal : have a CLI program started from bash which react similarly like other interpreters (take python as example).
I launch my sbcl program with cl-launch which work fine, but then my standard input is in cooked mode . Because of this I use croatoan doing
so I can get each char typed one by one (cbreak mode)to catch up and down arrows (for command history) and tab for autocompletion.
I have a few undesirable effect when I am in the with-screen macro :
(format t "abc~%123")
it prints 123 one line under abc but it doesn't print 123 at position 0 in that line. so I have to do a(format t "~c~%" #\return)
for a new line + carriage return.#\Esc
like when I press the Escape key on my keyboard.So how should I use croatoan to use my terminal window without a new screen even if I want to be in cbreak mode. how can I get the value of the arrow keys so I can propose command line history like most shells do.
Thanks.