I'm using cygwin. and use it with ssh to login into a ubuntu server. sometimes, I want to switch back to my cygwin and then quickly switch to ubuntu shell. How to do this?
You can background the ssh client just like any other shell job by sending it a signal and returning to the parent shell. Since the ssh client traps most key strokes, it would grab the normal shell job control keystrokes, but you can get its attention and get through to the shell using an escape sequence. For most ssh-clients this involves sending a
~ that has been directly preceded by a newline. The following sequence should do the job:
Enter ~ Ctrl+Z
After it is suspended you can continue using the local shell. When you want to go back to the suspended job, just run the
For further reading, look up Bash Job Control.
@Caleb's answer is good, but you could also consider installing a terminal multiplexer like
tmux. Apparently (according to what I can find on the web)
tmux has had some problems with running on Cygwin in the past, but I don't know about the current status of it.