Repository navigation
[consoleui] Make prompts work in non-fullscreen mode - #1283
Conversation
This change fixes issue jline#1239 by removing the use of alternate screen buffer (enter_ca_mode/exit_ca_mode) in the ConsolePrompt class. This allows the consoleui component to create UIs in the default buffer instead of always switching to full screen mode in the secondary buffer. Key changes: - Remove terminal.puts(InfoCmp.Capability.enter_ca_mode) from open() - Remove terminal.puts(InfoCmp.Capability.exit_ca_mode) from close() - Pass Display instance through the AbstractPrompt hierarchy - Simplify resetDisplay() method to avoid recreating the Display instance - Do not call reset() when refreshing the display - Do not redisplay the results and only print a newline at the end - Add UP/DOWN key bindings to InputValuePrompt This makes consoleui more suitable for CLI commands that need a nice interface without taking over the entire terminal.
ffde3d8 to
3947ebb
Compare
|
@quintesse do you want to give it a try ? |
|
@gnodet definitely! Hopefully I can find some time today 👍 |
|
The first thing I can tell is that db37cee seems to have broken the |
|
Also the So after running the build manually and this fix I can run the demo. |
|
Everything looks to work fine, except perhaps for a lack of "cleanup" of the last cancelled prompt, like this: Edit: just tried a simple test to see if it's an issue with cancelled lists, but no it really has to do with the last item being cancelled and exiting the prompt. Eg. if I swap the first two questions I get: |
Thx ! I've fixed the display at the end. I've raised another PR for the batch file which I've tested with Wine as I don't have a windows computer or VM available atm. |
|
Just tested it, works great! (and build file now works again on Windows 👍) |




This change fixes issue #1239 by removing the use of alternate screen buffer
(enter_ca_mode/exit_ca_mode) in the ConsolePrompt class. This allows the
consoleui component to create UIs in the default buffer instead of always
switching to full screen mode in the secondary buffer.
Key changes:
This makes consoleui more suitable for CLI commands that need a nice interface
without taking over the entire terminal.