Showing posts with label shell. Show all posts
Showing posts with label shell. Show all posts

Friday, January 27, 2012

screen command cheatsheet

>>screen #starts new screen session
>>screen -S <session-name> #starts new screen session with given name
>>screen -ls #list already running screen sessions
>>screen -r <pid/name>#re-attach to a screen session
>>screen -dr <pid/name> #detach other and attach yourself to given screen session

List all commands: C-a ?
New Window: C-a c

Moving Across windows..

Show Windows: C-a w
Next Window: C-a n
Prev Window: C-a p
Goto Window: C-a [0-9]
Last Window: C-a C-a

Sending literal C-a to shell: C-a a
Detach session: C-a d
Reattach session: C-a r

Toggle Scroll buffer mode: C-a ESC or C-a C-[  #then use C-n or C-p to navigate, in this mode you can use space to set first mark and then '>' to send the selected test to /tmp/screen-exchange file




Kill Window: C-a k or exit, killing last window will automatically kill screen session
Quit Screen: C-a :quit

Screen User's Manual

Tuesday, May 5, 2009

running cygwin bash within emacs

I've used cygwin on windows for a long time and I don't like the cygwin interface that much. So, I decided to run cygwin bash from within emacs. I put following(found here) in my emacs init file:
(defun cygwin-shell ()
"Run cygwin bash in shell mode."
(interactive)
(let ((explicit-shell-file-name
"C:/path/to/cygwin/bin/bash"))
(call-interactively 'shell)))

Now, I can do "Meta-x cygwin-shell RET" to run bash inside emacs and get all the editing power of emacs :) .
PS: Don't forget to append "C:/path/to/cygwin/bin/" to PATH or else most of the commands like ls, grep etc would not work.