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


Click here to return to the 'Tabbed Terminal alternative' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Tabbed Terminal alternative
Authored by: sapporo on May 04, '06 08:39:01AM

I'm quite sure that screen is the right thing to use, but I've just never found the time to get comfortable with it.

Any tips and tricks you'd like to share?



[ Reply to This | # ]
screen basics [Tabbed Terminal alternative]
Authored by: ubi on May 04, '06 10:16:45AM

I've found screen to be essential. Here's how I use it (note ^ means hold the 'ctrl' key down when typing the next letter; ^m is the same as hitting 'return'):

1. screen^m
2. ^a:captions always %w^m
3. ^ac^ac^ac^ac^ac
4. ^a0^aA^ufoo^mssh foo^m
5. ^an^aA^ubar^mssh bar^m
6. ^an^aA^ubiff^mssh biff^m
7. ^an^aA^ubaz^mssh baz^m
8. ^an^aA^uquux^mssh quux^m
9. ^ad

This may seem like a lot of work, just to get started. What I've done here is (1) started a screen session, (2) set a caption line at the bottom which will always show what 'tab' I'm in, (3) started five shells in separate tabs, (4-8) named each for a different machine [foo, bar, biff, baz, quux] and logged in to each using ssh, and (9) disconnected the session.

But the beauty thing is, I don't need to repeat this process ever, unless the machine I started the screen session on goes down. So 1-9 should be done on a server or desktop machine that stays up. (You can rlogin/ssh first from a remote machine, of course.)

To reconnect to the 5-tab session, log in to the server, type 'screen -rA' and be amazed! All the tabs are live; none of the ssh sessions are gone. If you start programs in different tabs (e.g., try running 'top' in the active tab) before disconnecting, they will still be running when you reconnect!

Now open a new terminal or log in to the server from a terminal on another machine (while keeping one eye on the session you just recovered), type 'screen -drA' and be even more amazed! The existing session disconnects, and you're reconnected in the new terminal. Everything is still live and working. What is even more cool is that, if your remote login is disconnected due to a network outage, the screen session normally disconnects cleanly and you can reconnect when the net comes back using 'screen -rA' again. This feature has saved me many times.

To move between tabs, type '^an' (next), '^ap' (previous), or '^a0' or '^a1' etc. for tabs named foo, bar, etc. '^a ' (space bar) also rolls to the next tab. '^aa' toggles between the two most recently selected tabs. Almost all the ^a commands tolerate holding the ctrl key down for the next letter as well. This is particularly nice for '^a^a' toggling... Remember '^ad' to disconnect and 'screen -list' to see that your existing (disconnected) session(s) is still running.

Hope this helps.



[ Reply to This | # ]
screen basics [Tabbed Terminal alternative]
Authored by: david-bo on Jun 13, '06 06:13:49AM

Point 2 should read

2. ^a:caption always %w^m

I.e., no 's' at the end of caption

---
http://www.google.com/search?as_q=%22Authored+by%3A+david-bo%22&num=10&hl=en&ie=ISO-8859-1&btnG=



[ Reply to This | # ]
Tabbed Terminal alternative
Authored by: svan on May 04, '06 11:59:02AM

Config I use: http://svan.redbrick.dcu.ie/configs/screenrc

Brief screen tutorial:
http://www.macdevcenter.com/pub/a/mac/2004/07/06/unix_gems.html

you can find more on google.



[ Reply to This | # ]