Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How to paste Escape sequences in Terminal's preferences' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to paste Escape sequences in Terminal's preferences
Authored by: sjmills on Jan 22, '04 11:43:24PM

I can get none of this to work. I'm using tcsh. Does the terminal type matter? I'm using ansi. All I want is to make get editing to work like it does in all correct Mac apps: option-left and -right for prev and next work, and forward delete to map to ^D.



[ Reply to This | # ]
How to paste Escape sequences in Terminal's preferences
Authored by: tanvach on Jan 23, '04 08:39:50AM

I've tested the hint and seems to only work with bash shell. Also, you need to do 'echo -ne "\e[5C"|pbcop' in bash since the -ne argument doesn't work with tcsh.



[ Reply to This | # ]
How to paste Escape sequences in Terminal's preferences
Authored by: clith on Jan 23, '04 02:20:51PM
Yes, in bash "\e" is translated to escape by the shell before it is parsed by the command you run (in this case echo). In tcsh you just type control-v and then type whatever special character you like. This is because tcsh by default uses escape sequences to edit text on the command line (esc-b is backward-word for instance -- see the tcsh man page for the "bindkey" built-in or type "bindkey" by itself to get a dump of all bindings.

So please note that this hint is bash-specific and sould read:

"How to bind keys for editing the command line in bash"


[ Reply to This | # ]
How to paste Escape sequences in Terminal's preferences
Authored by: ClarkGoble on Jan 23, '04 06:00:26PM
Is there a way in tcsh to do word forward / back or line begin / end? I'd truly like those features. I looked at the tcsh docs on bindkey and didn't see those as options.

Tcsh

[ Reply to This | # ]

How to paste Escape sequences in Terminal's preferences
Authored by: barthez on Mar 22, '04 05:41:21PM

For tcsh, put the following in your .tcshrc:

# moving backwards and forward one word with control-arrow
bindkey ";5D" backward-word
bindkey ";5C" forward-word

Bug: This prevents you from entering a plain old ";" on the cli. Thus, for chaining commands together, you'll have to use "&&" instead of ";". If you find a way to work around this, I'd be happy to know...



[ Reply to This | # ]
How to paste Escape sequences in Terminal's preferences
Authored by: geohar on Apr 01, '04 03:38:07AM
Make sure you've set up the following

set echo_style=both
Then the line below will get your sequence on the clipboard

echo -n "\\e[5~" | pbcopy
This can be made to work in tcsh.

[ Reply to This | # ]