Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I seem to be entering reset command on bash way too often.

I want to configure it to a keyboard shortcut.

Say Ctrl+r or something like that.

How to do it.

Update:

To answer the question, why I want to do this, and not just clear,

  1. So many times, I want to see git (or svn or hg) diffs and starting over from top is convenient, without bothering where was the command.

  2. So many times, the characters on the bash gets eaten up (and not displayed), when used as a server and some python stuff is done (And I know this is bash's problem because, zsh and fish dont have the problem). Only way to get it working back is reset.

share|improve this question
1  
Ctrl-l isn't enough? What problem are you facing that causes you to need to run /usr/bin/reset? –  Suppressingfire Nov 23 '09 at 11:35
2  
I've never had to use 'reset' so much so, I had to look up what it actually does. Are you 'cat'-ing binary files or something? –  JRT Nov 23 '09 at 12:36

2 Answers 2

You can modify your /etc/inputrc or ~/.inputrc file according to this syntax.

Bash also has a bind command that allows you to modify keybindings.

I think they share a similar syntax for running shell commands. Example:

$ bind -x '"\C-r"':reset
share|improve this answer
1  
Thanks! This works, but somehow, after Ctrl-r, the Up Down and tab completion all get screwed up! –  Lakshman Prasad Nov 23 '09 at 12:23
3  
Maybe because Ctrl+R is an already registered binding? –  Marcin Nov 23 '09 at 15:48
    
No, I tried with Ctrl+A as well. –  Lakshman Prasad Nov 25 '09 at 12:50
    
Are you saying that when /usr/bin/reset when invoked via Ctrl+A, it operates differently than when you run it by typing its name? –  Suppressingfire Nov 25 '09 at 14:12

I know Ctrl+L is the same as running clear command. If this is enough for you, then it's already implemented :)

share|improve this answer
    
Thanks. But, no not enough! –  Lakshman Prasad Nov 23 '09 at 12:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.