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
Location of prompt gets weird after window change #9319
Comments
this is related to the terminal printing lines not at the same speed as Nushell, as we've already seen during startup? 😮 |
We're hoping that someone gets so annoyed that they fix it. That may sound bad, but there's a lot going on and I don't think it's something trivial. Please someone work on this 🙏. |
May related nushell/reedline#665 |
Good luck @danielsomerfield. We'd welcome a fix. It's asked about frequently. |
Ok -- I think I've homed in on it and will re-work the logic a little bit. One problem is that it's setting it to the last row when it should be leaving it exactly where it already is. Another is that it isn't reacting to terminal clear, although it does work if you call Unless there is any great objection, I might flip the logic: right now the default is to change the location and it breaks out if it doesn't need to. I think it's a bit more intuitive to do nothing, unless it thinks it DOES need to. I haven't rebuilt all the cases yet but I think I should be able to. It might not be as terse as the current code, but it would be clearer what all the cases are. Ok with that? Once I have this fixed, I might be able to dig into some of those notes where edge cases are not handled. |
sounds like a fine plan |
Hopefully the noise isn't going to drive people to crazy on this issue. Let me know if it does and I'll keep it to myself. Latest finding: it appears the beahviour between term, iterm2, and kitty are all very different, iterm2, as least with my current configuration is the most dramatic. In particular, what happens when you start up with a clear screen but something in the buffer before the screen has been cleared. They all behave the same with completely empty buffers, it seems, but once their is some state built up, they deviate radically. I'll try and get as good of a compromise solution as I can to start and work with it for a while across multiple terminal configuration to see if I can figure out some clean common logic. |
I like your updates so please keep providing them. I personally test with probably a dozen different terminals but what may be most appropriate is to optimize for what the community uses based on our last survey, which is listed here https://www.nushell.sh/blog/2023-11-16-nushell-2023-survey-results.html#which-terminal-emulator-do-you-use-with-nushell.
I wouldn't want to have code that says, if you're on Alacritty, do x and if you're on Wezterm do y, but these should be a good testbed since it's the ones people reported using. |
I can definitely test on the ones with mac ports, but I might need someone to give a try to the windows. I might be able to swing the gnome-terminal if I can dig up some hardware for a linux desktop. Thanks for the reference to popular terms. Very helpful. |
Oh, and feel free to assign this to me if it would help tracking. It might take a week or two, but if that's ok, I'm committed to getting it fixed, if not perfectly, at least to be better than it is now. Up to you though--depends on how you like to manage the issues. |
I assigned it to you. Take your time. We're perfectly fine with incremental improvements. It doesn't have to go from broke to perfect in 1 PR. On my Mac I us UTM and run Ubuntu and Windows in VM. |
The brute force PR seems to be working ok, but here is an edge case. Also looking at performance. Nu.Shell.Bug.2023-DEC-16.mp4 |
Describe the bug
This occurs while starting a terminal with nushell in swaywm, then changing the windows, e.g. moving the terminal window from the bottom to the right, Location of the prompt jumps to the y-axis position of the terminal's cursor relative to the screen before the window movement after one keystroke.
Maybe sophisticated to describe, later shown in a video.
Tested with and without enabling
starship
.wm: sway 1.8.1
os: NixOS 23.11.20230527.e108023
tested terminal:
bash
zsh
fish
all've no this issue in my environment.How to reproduce
shows in the video below.
The prompt jumps into the bottom after one keystroke.
Expected behavior
Works as other shells.
Screenshots
No response
Configuration
Additional context
nushell configuration:
https://github.com/oluceps/nixos-config/blob/main/home/programs/nu/config.nu
https://github.com/oluceps/nixos-config/blob/main/home/programs/nu/env.nu
The text was updated successfully, but these errors were encountered: