Control + L not clearing screen

6,253

Solution 1

remap control :

bind -x '"\C-l": clear'

Solution 2

I typically have a ~/.inputrc where I put following bindings

"\C-p":previous-history
"\C-n":next-history
"\C-a.":beginning-of-line
"\C-e.":end-of-line
"\C-l":clear-screen
Share:
6,253
Adam
Author by

Adam

Updated on September 18, 2022

Comments

  • Adam
    Adam almost 2 years

    When I try to clear my terminal screen on OSX:

    computer@ ~ () $ ^L
    

    And when I hit Enter after that it just shows:

    -bash:
       : command not found
    

    Any ideas on how this happens?

    My .bash_profile, .profile, and .bashrc are empty.

    • Adam
      Adam almost 10 years
      That worked, however I'm curious of how it came unbound.
    • Raza
      Raza almost 10 years
      i am not sure.. should check default value I don't know where they defined..
  • helix
    helix over 5 years
    +1 for the .inputrc solution.
  • SamAndrew81
    SamAndrew81 over 4 years
    This works in the session, but the problem always comes back in the next session. How can I make this persistent? EDIT: Phillppe's answer below worked. :)
  • SamAndrew81
    SamAndrew81 over 4 years
    Best answer here - it is persistent.