-
Notifications
You must be signed in to change notification settings - Fork 52
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
restore screen after adding tasks #311
Comments
I'm afraid I don't understand the issue you're reporting. |
Here's the detailed steps to reproduce the issue:
|
OK, I see now. I believe we may run into a worse UX situation trying to fix this. If we eliminate the clear screen for commands like adding tasks, I believe the display will not be as user friendly, as the various command outputs will just pile up on the screen. The way that works now seems correct from a UX perspective. However, clearing the screen the way I do clears the screen, meaning it also removes any non-VIT related content that was there before. We could also fix the inconsistency on the other end by clearing the screen upon a clean VIT exit: diff --git a/vit/application.py b/vit/application.py
index 0a92399..9109dda 100644
--- a/vit/application.py
+++ b/vit/application.py
@@ -552,6 +552,9 @@ class Application():
return False, False
def quit(self):
+ self.loop.stop()
+ clear_screen()
+ self.loop.start()
raise urwid.ExitMainLoop()
def build_task_table(self): That way you always return to a clear screen upon exit. I'm not really sure what that buys us, as in that case there's no need to clear the screen for any functionality that VIT is performing. If there's a way to somehow collect what's on the screen, hold it, then put it back after VIT exits, I don't know what it is. |
It's the altscreen termcap. It's just yet another ansi sequence (see https://stackoverflow.com/a/11024208), but it is better managed by the curses module of python. Refactoring vit with curses is aesthetically the better solution, but it could be a giant pull request with little visible short-term benefit. I could make the PR if it's allowed. After inspecting into the code a bit, this becomes a very suspicious claim to me:
since I've not found any use of curses after initialization. It might have used curses during the perl era but hardly ever since. |
VIT uses the Python Urwid library, which I'm pretty sure uses curses under the hood. There's no way I'm refactoring to use curses natively. If there is a more surgical implementation to address this issue, I'm happy to look at it. |
@champignoom the offending code is here: https://github.com/vit-project/vit/blob/2.x/vit/process.py#L44-L55 I think it would be possible to refactor that to preserve the original terminal content, but in my poking around there are some gotchas:
|
Also, I did check, and while Urwid does have a |
Is your feature request related to a problem? Please describe.
After adding a task, seeing the following message
and quitting from vit, the entire screen is cleared.
If I quit immediately from vit after launching it, the screen is not cleared.
Describe the solution you'd like
The screen should be restored after vit terminates.
Additional context
The text was updated successfully, but these errors were encountered: