-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Messy output when using reboot/shutdown #126
Comments
It might be the case that you can stop the running set/get loop when the code reaches https://github.com/apognu/tuigreet/blob/master/src/power.rs#L18 -- This may stop the rendering, but let stdout still print from a different process. |
Or maybe a cleaner approach would be to do it when the main module receives the power event https://github.com/apognu/tuigreet/blob/master/src/main.rs#L93 |
Some progress, it looks like clearing is not enough, as it still retains its cursor position. This patch does clear all the visual elements off the screen as intended, but still need to look at resetting the position of the cursor. ... This should also call clear only once, but used it twice when experimenting. index c26877d..5d0ab7d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -79,7 +79,9 @@ async fn run() -> Result<(), Box<dyn Error>> {
let command = greeter.write().await.power_command.take();
if let Some(command) = command {
+ clear_screen(); // Call clear_screen after receiving the power command event
power::run(&greeter, command).await;
+ clear_screen(); // Call clear_screen after receiving the power command event
}
}
} |
We probably need to exit raw mode before clearing the screen. I'll look into it if I can reproduce. |
I should have included... I reach this state when I set tuigreet to use the openrc-shutdown -p now command in its command line arguments. Tuigreet is launched by greetd. I'm assuming it's similar behavior to most other shutdown commands. |
Are you able to build the binary out of the |
Yeah this was reported in #130 and fixed on the main branch. It should not be present once merged. |
The system (in my case OpenRC) prints to stdout when the runlevel changes. This is normally very good.
I believe tuigreet is somehow holding onto the cursor position and the screen contents, forcing what character position stdout gets shown from.
I think this because the stdout messages get written to the spot where the username/password input is at on tuigreet. This indicates to me that the tuigreet is 'grabbing' the text input position, and as stdout prints, it prints from where tuigreet says is the position.
This is different than other issues #68 because this is shutdown, not startup. While I could set the system not to log these to stdout, I'd rather see them and have them land properly with tuigreet.
One solution I could think of would be to clear the screen, and stop the 'render loop' of tuigreet whenever the reboot or shutdown commands are invoked. This would let the terminal start in the top left character and not be disturbed from tuigreet setting the prompt for username/password.
This solution wont work for the startup flavor of this issue. This is only for shutting down.
As a note, if i run the shutdown from within wayland, it works as expected showing the last output and "skipping" the tuigreet.
This is only an issue when i shutdown/reboot before logging in, OR if i exit wayland to see tuigreet and then shutdown/reboot.
Here is an image of the behavior I'd like to resolve:
The text was updated successfully, but these errors were encountered: