ncspot
ncspot copied to clipboard
Screen Redraw Is Scoped To Initial Window Resolution
Describe the bug This bug is partially in reference to #609. 'Ctrl + L' does well to resolve the "garbled text" issue seen when moving or resizing a window, but it redraws to the initial resolution of the terminal window when the program was started. Ideally the redraw call would poll for the existing window's dimensions and implement those rather than the cached value from initialization. This is observable in the current Windows build utilizing Powershell by way of the Windows Terminal. (I've also encountered similar issues at the time of launch of the program, but have been unable to reliably reproduce thus far.)
To Reproduce Steps to reproduce the behavior:
- Launch ncspot in the terminal emulator of your choice
- Resize the emulator to a different size
- Trigger the redraw command via 'Ctrl + L' hotkey command
- If the new size is smaller than the initial window resolution, there were be "overdraw" of ncspot. Should the new resolution be larger, ncspot will take up a portion up to but not beyond the initial resolution (anchored to the top left corner).
Expected behavior ncspot should resize to the current window's resolution at the time of the redraw command. Ideally this would be automatic, but one thing at a time.
Screenshots
Default:
Redrawing to a larger size:
Redrawing to a smaller size:
System (please complete the following information):
- OS: Win10
- Terminal: Windows Terminal (current)
- Version: 0.9.5
- Installed from: GitHub Release Page
Backtrace/Debug log Can provide if needed.
Additional context Comments on my music tastes are not solicited, but also not unwelcome. :v
I can also reproduce this issue (has been present since a long time now).
Hmm, it could be a problem with pancurses/pdcurses not updating the screen size when the terminal is resized on Windows :thinking:
Yeah, I think so. There was an issue upstream https://github.com/gyscos/cursive/issues/461, but it seems to be related to Linux.
Would it be possible to manually fetch the terminal dimensions when a user explicitly calls the resize
event (i.e. through pressing Ctrl+L)?
Not easily, there is also no option to redraw for a specific screen size. I believe this needs to be fixed upstream.
If I recall, building on Windows using cursive/crossterm-backend
feature flag instead of cursive/pancurses-backend
would allow the window to be resized.
The cursive/crossterm-backend
feature supports more stuff like mouse scrolling, bold/italic text and resizing as you said, but the huge disadvantage is the flicker - the entire screen redraws on each tiny change, making it unusable. Any way around that?
Not sure, I don't use Windows so I can't really help with that, sorry :/
Jumping in to ask something that may be related - I also see that emoji/unicode characters are not drawn correctly in PowerShell (or in WSL via ncspot.exe
):
Although they are drawn correctly when installed in WSL and running the Ubuntu executable:
Should I open a new issue for this, or is it related ? Both screenshots are taken in Windows Terminal on Windows 11 22H2 (22621.2215)