generated from akkadotnet/build-system-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
When a Termina application exits, the terminal can be left with visual artifacts or in an inconsistent state. The host application has to manually reset terminal state after Termina shuts down.
Current Workaround
We had to add manual terminal reset code in our application:
private static void ResetTerminal()
{
try
{
// ANSI escape sequences to reset terminal state:
// \x1b[?25h - Show cursor
// \x1b[0m - Reset all attributes
Console.Write("\x1b[?25h\x1b[0m");
// Clear any partial line artifacts
Console.WriteLine();
// Reset console properties
Console.ResetColor();
if (!Console.IsOutputRedirected)
{
Console.CursorVisible = true;
}
}
catch
{
// Ignore any errors during terminal reset
}
}This is called after host.StopAsync() completes.
Expected Behavior
Termina should automatically:
- Exit alternate screen buffer (
\x1b[?1049l) if it was entered - Show cursor (
\x1b[?25h) - Reset all text attributes (
\x1b[0m) - Reset colors to terminal defaults
- Clear any partial rendering artifacts
This cleanup should happen in the TerminaHostedService.StopAsync() or equivalent shutdown path.
Environment
- Linux terminal (also likely affects macOS Terminal, iTerm2, Windows Terminal)
- Termina 0.1.x via
AddTermina()hosting extension
Metadata
Metadata
Assignees
Labels
No labels