Sample Header Ad - 728x90

What does Ctrl+L do "under the hood", if not invoke clear?

0 votes
1 answer
47 views
I've noticed that using Ctrl+L to clear my terminal has some differences from using the clear command (from ncurses 6.5.20240427). It seems that the clear command will wipe every character in the terminal, set the cursor at the top left, and then type out the prompt. result of the clear command Ctrl+L might seem to do the same, but the upper 2 lines of my prompt (and the blank line above it) don't show. result of Ctrl+L Interestingly, if I had something typed after the prompt, it retains that - and not just the line that the prompt was on, but everything after the prompt. ctrl+L when text had been typed I looked into man clear and found no options to replicate this behaviour, so what exactly is Ctrl+L doing under the hood? Is it invoking a program, or is it a behaviour built into most terminal emulators with implementation down to the specific terminal?
Asked by Josh Brunton (146 rep)
Apr 4, 2025, 02:29 PM
Last activity: Apr 4, 2025, 02:44 PM