Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vddrnnr

macrumors 6502a
Original poster
Jan 23, 2017
509
769
Hi all,

One of the things that using OSX Terminal allowed, I think it was from OSX 10.6 onwards, was
the possibility to jump between "words" in a command line to quickly get
to the desired location you need to change.
This is done by using the "Alt-Arrow" Keys

In Leopard and Snow Leopard PPC this does not happen.
I don't know if this is common knowledge but I'm sharing this with you
as it may be of use to some.

To achieve the behavior mentioned above you need to edit the file
".inputrc" ( yes it has a dot in the beginning ) in your user's home folder.

In this file write

"\e[C" : forward-word
"\e[D" : backward-word

If you are doing the editing through the Terminal app close it and open again.
That's it you can now jump between words :D

PS. This works with Leopard and upwards

Edit: Found something strange but the bellow works with "CTRL-Arrow" ( verified )
Sorry looking better about Alt

"\e[5C" : forward-word
"\e[5D" : backward-word

Best regards,
voidRunner
 
Last edited:
Hi all,

Ok I've found the "right way" to do this.
So the correct sequence is

"\e\e[C" : forward-word
"\e\e[D" : backward-word

And after you need to go to Preferences and select in the "Settings" tab
the Profile you use for example "Pro".
After press the "Keyboard" button on the right and check "Use Option and meta key"

That's it now it will work as expected :D

Best regards,
voidRunner
 
Hi all,

One of the things that using OSX Terminal allowed, I think it was from OSX 10.6 onwards, was
the possibility to jump between "words" in a command line to quickly get
to the desired location you need to change.
This is done by using the "Alt-Arrow" Keys

In Leopard and Snow Leopard PPC this does not happen.
I don't know if this is common knowledge but I'm sharing this with you
as it may be of use to some.

To achieve the behavior mentioned above you need to edit the file
".inputrc" ( yes it has a dot in the beginning ) in your user's home folder.

In this file write

"\e[C" : forward-word
"\e[D" : backward-word

If you are doing the editing through the Terminal app close it and open again.
That's it you can now jump between words :D

PS. This works with Leopard and upwards

Edit: Found something strange but the bellow works with "CTRL-Arrow" ( verified )
Sorry looking better about Alt

"\e[5C" : forward-word
"\e[5D" : backward-word

Best regards,
voidRunner

Nice fix!

If I wanted to make this a global configuration, rather than user-level, where would I want to place this .inputrc?
 
Hi @B S Magnet,

To make it system wide you can put .inputrc as inputrc ( without the dot ) in /etc .
I've just tried it to be sure and it worked ;)

Best regards,
voidRunner
 
  • Like
Reactions: B S Magnet
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.