brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: reset and stty sane repair a terminal that shows garbage

Terminal
~/tips/tip-terminal-reset-stty-sane-garbage

stty sane

Restores a terminal that was scrambled by binary output.

Printing a binary file by accident leaves some terminals unreadable, and closing the tab is not the only fix.

reset
stty sane

reset reinitializes the terminal and clears the screen. stty sane only restores the line settings such as echo and line endings. Type the command blind if you cannot see what you type, and press Ctrl+J instead of Enter, because Enter may no longer work on a garbled terminal. If the problem repeats with one program, run it through cat -v or strings rather than printing raw bytes.

Further reading: reset manual page

More Terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac mc hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}' All Terminal tips (116) All topics

Link