How do I keep mac terminal keybindings when connected via ssh to a linux server?

3

My Setup

computer: Macbook pro

OS: OS X Snow Leopard

Software: Terminal.app, GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)

The Server's Setup

Hardware: Not sure

OS: Ubuntu 11.10

Software: GNU bash, version 4.2.10(1)-release (x86_64-pc-linux-gnu)

The Issue

When logged into a linux server via ssh, I find that a lot of the keybindings (mostly default) I use don't seem to work. Specifically stuff like tab completion, history etc.

I sort of understand why this would be the case, as these are two different operating systems; however I was wondering if there would be a way of preserving some or all of my current keybindings when logging into the other server?

There are quite a few different keybindings I would like to have available, but these are some that I use most commonly:

  • fn + left-arrow = home
  • fn + right-arrow = end
  • Tab completion of file names/locations

The first two are custom keybindings, not the mac standard.

Sam Murray-Sutton

Posted 2011-11-30T20:47:50.770

Reputation: 193

2Try looking into .inputrc on your local computer and the server you are SSH'd into. You can change keybindings there. I don't know about OS X, but I'm assuming there's a /etc/.inputrc and possibly a ~/.inputrc and there will be those on the server, too. – Rob – 2011-11-30T20:54:19.853

Please explain in more detail what keybindings exactly (for what functionality) you want on the server. – Daniel Beck – 2011-12-10T09:24:51.850

Answers

0

Try with the loadkeys command.

You should find the correct map according to your language. The keyboard maps are located in different folders depending on your linux distribution. In the case of RHEL and derivates (CentOS, SL, ...) you can find them under /lib/kbd/keymaps/, and for mac in particular, have a look at: /lib/kbd/keymaps/mac/all/

So, the final command will look like this.

$ /bin/loadkeys /lib/kbd/keymaps/mac/all/mac-us.map.gz

jap1968

Posted 2011-11-30T20:47:50.770

Reputation: 827

To the best of my knowledge Loadkeys isn't available on Mac os x, which is a shame as it seems a really useful way of managing bindings. – Sam Murray-Sutton – 2012-01-03T14:08:44.443