Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use ssh to log into a remote machine and then I use the screen command to create a virtual screen.

Now, if I type in exit normally I should only exit the screen and return to the remote ssh terminal but the reality is the exit command exits the ssh and I return to the local terminal. Why?

Besides, if I run a program/process in the virtual screen, I can't use C-a d to return to the remote ssh terminal, it just echoes back ^A^A^A^A^A^A^A^A^A^A^A^A^A^, and doesn't return to the remote ssh terminal.

root@remote_lab:/home/esy# time bash test.sh  2>&1|cat > temp

What could be going wrong?

share|improve this question
Describe what happens when you run screen (what appears on the screen and where). What terminal are you running in on your local machine? What does echo $TERM show locally, in the ssh session, and after running screen? What happens if you type C-a ? after running screen? – Gilles Jan 3 '13 at 1:27
What you described sounds exactly like the behavior with no screen running, so I second @Gilles's question... – njsg Jan 8 '13 at 17:30

Are you sure that you are in a screen?

If so, the TERM variable should look like this:

$ echo $TERM
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.