-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resizing Breaks Completer #586
Comments
If you cannot use system terminal which handles |
Hm.. I've got this signal listener (pictured), which is similar to the one in the ShellFactoryImpl. It works fine for the terminal, i.e. if I resize and print values then they'll be the correct size for the re-adjusted terminal. My main issue however, is that the completer doesn't resize/disable on resize. So if I TAB for auto-complete and resize, I get the issue above, where the completer text is skewed and permanent (i.e. it doesn't disappear after I finish completing, as it normally does). Resizing works perfectly fine everywhere else. Any idea how I can force the completer to either disable and re-enable or handle the window resize mid-input? |
I have been able to reproduce the problem. It will happen when the candidates do not fit to the visible area of the display when resizing window. I think this can be fixed only in JLine. You can create a widget to refresh tab completions:
To write this in java see example in Widgets and key mapping |
Hi,
If you resize during a readLine call with a completer active, the completer doesn't resize properly and ends up with options thrown all over the place (as shown). They also don't disappear once the word has been matched (even if I use CTRL+C to exit the search).
The image also shows the known completer overlapping issue, so just ignore that (I already know you're fixing in 3.16.1), I've temporarily 'fixed' it by using a blank right prompt which overlaps the overlapped line.
Before resize:
After resize:
For info I'm using the terminal defined by the following:
Terminal terminal = TerminalBuilder.builder() .system(false) .type(environment.getEnv().get(Environment.ENV_TERM)).streams(in, out).size(new Size(Integer.parseInt(environment.getEnv().get(Environment.ENV_COLUMNS)),Integer.parseInt(environment.getEnv().get(Environment.ENV_LINES)))).build();
And using Windows PS (inside Windows Terminal app) and PuTTY to test. The issue is the same on both.
The completer I'm using is the ArgumentCompleter with a StringsCompleter and NullCompleter.INSTANCE (the String is using a List).
The text was updated successfully, but these errors were encountered: