Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Seems like ^L usually clears things up when this happens.


That's what I came to post. Yes, the terminal gets mixed up because it handled input that bash didn't see. And that's annoying (really it's a bug, just one so ancient no one is interested in fixing it anymore).

But terminal corruption used to be far more common (line noise, etc...) and bash has a built-in escape for this. Ctrl-L (chosen for the analogy with form-feed/"vertical tab" on a printer) will blank the screen and redraw your current edit environment at the top.


I don't see it as a bug; the shell shouldn't get to see what was written to the terminal?

BTW, it's the readline library that handles the Ctrl-L key binding to clear the screen rather than bash per se.

    $ bind -p | grep '\\C-l'
    "\C-l": clear-screen
    $




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: