How to get rid of remnants of an alternative screen in TTY? Perhaps a specific setting needs to be enabled? Using TerminusBold font of size 12x24. GPU: VirtIO.
To get rid of alternative screen remnants in TTY, you need to use the correct clearing commands and possibly configure terminal parameters. Your combination of TerminusBold 12x24 and VirtIO GPU may require additional settings for proper screen clearing.
Contents
- Main TTY clearing methods
- Terminal parameter configuration
- Specific solutions for VirtIO GPU
- Permanent cleanup configuration
- Alternative approaches
Main TTY clearing methods
The most effective ways to clear alternative screen remnants in TTY are:
-
Using the
resetcommand - the most reliable complete terminal resetbashreset
-
Combination of ANSI escape sequences - allows precise control over clearing
bashecho -e "\033[2J\033[H" # Clear screen and move cursor to beginning -
Using
tputcommands - low-level terminal controlbashtput reset
As mentioned in the documentation, the tput reset command is especially effective for restoring the terminal after working with fullscreen applications.
Terminal parameter configuration
For your configuration with the TerminusBold 12x24 font, additional configuration may be required:
-
Check current font settings:
bashshowconsolefont
-
Temporarily change font size (if current one causes artifacts):
bashsetfont ter-v12b
-
Configure terminal parameters:
bashstty sane # Restore standard terminal parameters
As discussed in Arch Linux, clearing issues are often related to incorrect terminal parameter configuration after using fullscreen applications.
Specific solutions for VirtIO GPU
VirtIO GPU may require special approaches to screen clearing:
-
Using VidControl (if available):
bashvidcontrol -f default
-
Force redraw through kernel:
bashecho 1 > /sys/class/tty/tty0/active -
Configure GRUB boot parameters for proper VirtIO operation:
bashGRUB_CMDLINE_LINUX="console=tty1 nomodeset"
It’s worth noting that as mentioned in discussions, the console=tty1 parameter can help solve screen clearing issues on virtual machines.
Permanent cleanup configuration
To avoid recurring problems, set up permanent parameters:
-
Editing
/etc/default/console-setup:bashsudo nano /etc/default/console-setupAdd parameters:
FONTFACE="TerminusBold" FONTSIZE="12x24" ACTIVE_CONSOLES="/dev/tty[1-6]" -
Automatic clearing on system login:
Add to~/.bashrcor~/.profile:bash# Clear terminal artifacts on startup [ "$TERM" = "linux" ] && reset -
Configure GRUB for proper operation:
Edit/etc/default/grub:bashGRUB_CMDLINE_LINUX="console=tty1 quiet splash" sudo update-grub
As shown in configuration examples, proper font and terminal parameter configuration significantly improves TTY performance.
Alternative approaches
If standard methods don’t work, consider alternative solutions:
-
Using
fbtermfor improved font rendering:bashsudo pacman -S fbterm -
Running through tmux/screen for session isolation:
bashtmux new-session
-
Manual screen buffer management:
bash# Full clear while preserving history clear && history -c
As noted by Arch Linux users, for complex cases with screen artifacts, a combination of methods may be required.
Sources
- Clearing TTY after working with applications
- Configuring fonts in Linux console
- Changing TTY fonts
- Screen clearing issues
- Configuring GRUB for console
- Choosing fonts for TTY
Conclusion
- For quick clearing, use the
resetcommand or the ANSI escape sequence combination\033[2J\033[H - For a permanent solution, configure parameters in
/etc/default/console-setupwith your TerminusBold 12x24 font - When working with VirtIO GPU, add the
console=tty1parameter to GRUB_CMDLINE_LINUX - For complex cases, consider using fbterm or tmux for session isolation
- Regularly check terminal status with the
stty sanecommand after working with fullscreen applications
The optimal solution for your configuration is a combination of reset and proper GRUB boot parameter configuration, which should completely eliminate alternative screen artifacts.