-
Notifications
You must be signed in to change notification settings - Fork 164
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
0.30.0 (Nu 0.91.0) does not respect cursor position after host cmd exec in a keybinding #771
Comments
This seems related
|
Hmm.. To me this other issue is not conflicting with mine, if the command doesn't output anything it should definitely avoid printing a new prompt, but in my case the command did output stuff so there should be a new prompt below that output 🤔 I think the correct logic, that would work for both cases would be:
NOTE: this is the kind of behavior I have in my zsh setup, except zsh doesn't even bother with saving/comparing positions and I simply have to manually print a newline before running my cmd so the output is below current prompt |
I think it is better to print a newline manually. |
the issue is that the output of the command is cleared, when it should be shown and stay then a new prompt should be printed |
This is because when the prompt is at the very bottom of the terminal, all output will scroll the window, and the final prompt will be at the same position as before on the terminal grid (but not on the scrollback but that's not taken into account). |
I think there are two valid usecases to cater to:
As output from other tools is outside our control in reedline, detecting what we should do is either a somewhat heuristic endeavour.
|
Note that for me in some cases I don't know in advance if the command is going to to output something or not. In this case the heuristics like I mentioned would be the only way afaik 🤔 |
Mhh if we don't want to introduce the complexity of having two different bindings Line 675 in 0698712
initialize_prompt_position was not working before #758)
But maybe your case with the pager either going into alternate screen or writing directly may be an argument for separating that? |
Just for clarification, my pager always goes into alternate mode |
Can someone transfer this issue to reedline's repo? I have a PR coming to fix this properly |
Describe the bug
In zsh I'm used to have a number of keybindings that run commands so I don't need to type them as they are so common, especially some
git
commands.In nushell I previously (in 0.89.0) was able to do something like this by simply executing a command and the prompt would continue where it was, but with 0.91.0 the output of my command is cleared and prompt is reset to where it was before. ☹
How to reproduce
Alt-g
keybind to rungit status
Expected behavior
I expected nu to continue working as it was before, allowing me to run commands by keybindings and see its output
Screenshots
nushell.cmd.output.in.keybind.hidden.mov
Configuration
Additional context
No response
The text was updated successfully, but these errors were encountered: