gorn.ch

Tobias Ebnöther's personal blog

Living with Terminal.app

Ok. My Terminal.app escapade has a bit gone out of hand so I decided to make a new post with all settings I changed.

Open your Terminal.app preferences and set it to xterm (xterm-color doesn't work very well in most places).

Open the window settings and delete all Settings for page up / down, home, end and delete (with all modifier variations).
Now set it up like this:
Home:		   \033[~1
End: \033[~4

Shift + Home: scroll to start of buffer
Shift + End: scroll to end of buffer

Delete: \033[~3

Page Up: \033[~5
Page Down: \033[~6

Shift + Page Up: scroll to previous page in buffer
Shift + Page Down: scroll to next page in buffer

To get a nice behaviour on the shell now edit your ~/.inputrc like this:
# Be 8 bit clean.
set input-meta on
set output-meta on
set convert-meta off

# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line

# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert

# mappings for "page up" and "page down"
# to step to the beginning/end of the history
"\e[5~": beginning-of-history
"\e[6~": end-of-history

At last to get Shift+Page working with screen add the following lines to your ~/.screenrc:
termcapinfo xterm ti@:te@
defscrollback 1 #Will be handled localy

I learned a lot from this article but it was a bit imprecise concerning to the page up / down buttons and didn't provide the screenrc options. That's why I decided to make a new post.

Update:
To remove the scrollbar while not losing the buffer in your Terminal.app edit the following lines in your .term or .plist file:

<key>Scrollbar</key>
<string>NO</string>
Related Entries:
Fixing the delete key in Terminal.app
Nice screenrc and common keystokes
NetNewsWire Lite vs Vienna memory usage
tail -f to growl
xchat on OSX / Command as alt
Comments (5)  Permalink

Comments

falki @ 01.02.2007 17:30 CEST
very interesting...
ebi @ 01.02.2007 17:36 CEST
This is probably very helpful to some Mac or Linux users so I'm sure some people out there find it really interesting.
ara.t.howard @ 15.05.2007 05:38 CEST
all the keys for Terminal.app were wrong for me: the ~ goes on the end. so

Home :
synack @ 16.05.2008 08:07 CEST
Anybody has an idea how to achieve this:

1. Press SOME_KEYS and result would be delete whole {world, string} instead of character by character

2. Jump {word, string} instead of character by character
ebi @ 16.05.2008 08:53 CEST
@ara.t.howard:
Probably this can help you: http://fdiv.net/2007/05/12/keybindings-in-macosx-terminal-app/ (I managed to map those keys correctly but have no clue how I did that ;))

@synack
1. Is possible by pressing ⌃U (or ⌃W for single words)
2. Is possible by pressing ⎋f or ⎋b
No new comments allowed (anymore) on this post.
Powered by Flux CMS