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

Nice screenrc and common keystokes

I like to work with screen because I can easily switch between different virtual consoles and attach them somewhere else if needed. So here is how I setup my screenrc:

vbell off                  #Don't display the wuff wuff stuff
defutf8 on #Turn on UTF-8 by default
shelltitle "$ |bash" #Standard Shell title will be replaced by bash
caption always #I never use split view but like the caption
caption string "%{= wk}%w" #Show me all opened consoles with white on black

Add this to your .bashrc to get nice console names (usually the runnig programm):

export PROMPT_COMMAND='echo -ne "\ek\e\\"'

Here are the keystokes I use very often:

Create new console:        ^A c
Get to next console: ^A n
Go to last console: ^A a
Go to specific console: ^A <consolenumber>
Deattach screen: ^A d
Related Entries:
NetNewsWire Lite vs Vienna memory usage
Living with Terminal.app
Fixing the delete key in Terminal.app
tail -f to growl
xchat on OSX / Command as alt
Comments (1)  Permalink
1-2/2
Powered by Flux CMS