View previous topic :: View next topic |
Author |
Message |
AssociateX Tux's lil' helper
Joined: 19 Feb 2004 Posts: 134 Location: North Dakota
|
Posted: Sun Feb 18, 2007 5:40 pm Post subject: HOWTO(small):screen, the app |
|
|
TO START SPLIT SESSION
Open a terminal and run the following command:
Then do the following key combinations:
"ctrl a" then "shift s" <---- Creates the split.
"ctrl a" then "tab" <---- Changes the focus to other region.
"ctrl a" then "ctrl c" <---- Starts new shell in new region.
TO NAVIGATE SPLIT SESSION
"ctrl a" then "tab" <---- Changes the focus to other region.
"ctrl a" then "spacebar" <---- Switches the regions session to other running sessions.
RUNNING APPS EXAMPLE 1
Navigate to the screen region that you want to run your app from then run the following command:
"ctrl a" then "tab" <---- Changes the focus to other region.
enter password then
Now you can see that "top" shows "emerge" using 75% of your cpu.
RUNNING APPS EXAMPLE 2
Of course you could also use an editor in one region to edit a conf file and in the other region stop and start the process to see how the change has taken place.
Code: | vi /etc/conf.d/clock | then change the CLOCK="local" to "UTC" or visa versa, save/write to file but don't close the editor and file.
"ctrl a" then "tab" <---- Changes the focus to other region.
Code: | /etc/init.d/clock restart | now you can see the time get's all screwed up so...
"ctrl a" then "tab" <---- Changes the focus to other region.
Code: | vi /etc/conf.d/clock | change back to "UTC" or "local" then save to file again
"ctrl a" then "tab" <---- Changes the focus to other region.
Code: | /etc/init.d/clock restart | now you can see the time is back to what it was before this example.
*********************************************************************************************
TO USE SCREEN WITH ssh FOR TWO USERS
I'm using this example for a LAN but it works just as well over the net.
Remote computer 192.168.0.1 <---- Needs help.
From this computer run the following:
Local computer 192.168.0.2 <---- Smart person offering help.
From this computer run the following:
Code: | ssh [user@]192.168.0.1 | then password <---- Use a regular account not root.
Then run:
Now both users(Local and Remote) can see and have control over the prompt and what ever is typed to it.
Remote computer 192.168.0.1 <---- Needs help.
then password <---- This allows the Remote user to give root level access without giving out the password for root. This is not a catchall for safety though.
SCREEN CHAT OPTION
Local <---- Smart person offering help.
"ctrl a" then "shift s" <---- Creates the split.
"ctrl a" then "tab" <---- Changes the focus to other region.
"ctrl a" then "ctrl c" <---- Starts new shell in new region.
Now the Local user has a split screen with a regular user session below the root session
Remote <---- Needs help.
"ctrl a" then "shift s" <---- Creates the split.
"ctrl a" then "tab" <---- Changes the focus to other region.
"ctrl a" then "spacebar" <---- Switches the regions session to other running sessions. Hit until you find the regular user prompt.
Now both Local and Remote users have split screens that they both have control over and can see what the other is typing (except for passwords). Either user can do the following.
"ctrl a" then "n 0" <---- To switch to the work region
"ctrl a" then "n 1" <---- To switch to the chatting region, just start each line with a "#"
Code: | #What the heck does that do?
#It updates foo so bar doesn't happen again.
#OK, thanks man, you're the greatest. |
If you people don't like the split for chat deal you can kill it off with:
"ctrl a" then "shift X" <---- This kills the region that you are in so make sure you are in the right one.
"ctrl a" then "spacebar" <---- Finds the open session so you can end it.
"exit"
The other user at this point will just have to do the following:
"ctrl a" then "shift X"
You could still use "#" for sending messages it will just be hard or impossible if there is a long emerge going on or something else hogging up the terminal...like "top".
I've used this info to help someone install Gentoo on their computer so they could watch and ask questions.
"man screen" for other stuff that you can do with screen. In "man screen" they use a different convention than I have used here, "C-a tab"
"C-a tab" which means "ctrl a" then "ctrl tab" for switching the input focus to the next region.
"C-a C-c" which means "ctrl a" then "ctrl c" for creating a new window with a shell and switching to that window.
"C-a X" which means "ctrl a" then "shift X" for killing the current region.
You get the drift. _________________ AssociateX
Gentoo rocks! |
|
Back to top |
|
|
krolden Apprentice
Joined: 28 May 2004 Posts: 293 Location: Belgium
|
Posted: Sun Feb 18, 2007 8:55 pm Post subject: |
|
|
I've been using screen for a long while now, but I didn't know about this. Thanks for sharing |
|
Back to top |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5934
|
|
Back to top |
|
|
bludger Guru
Joined: 09 Apr 2003 Posts: 389
|
Posted: Wed Feb 21, 2007 2:32 pm Post subject: |
|
|
I like the tab bar, which is also described in the wiki. My personal .screenrc entry looks like this:
Code: | hardstatus alwayslastline "%{bd}[ %{B}%H %{b}][%{B}%-w%-u%{WK}%n-%t%{Bd}%+u%+w %= %{b}][%{B} %D %0d.%0m.%Y %0c %{b}]" |
I tried this together with split screen, but it was a bit confusing and probably unnecessary. |
|
Back to top |
|
|
senz n00b
Joined: 12 Jan 2005 Posts: 19 Location: Frankfurt
|
Posted: Wed Feb 21, 2007 10:24 pm Post subject: |
|
|
heh, im using screen on various unix'es since at least 1999, mostly just for detaching irc-sessions, and now i found its so much more useful then i thought it was. im a dumbass :p |
|
Back to top |
|
|
|