My .screenrc has the following line:

escape ^Jj

However, I can't manage to send a literal ^J in a screen session based on this!

  • Version: Screen version 4.06.02 (GNU) 23-Oct-17
  • Host: Debian-based Linux

C-j ? shows Command key: ^J Literal ^J: j

Interestingly, when I set the key using C-j :escape ^Jj, I CAN send the control character successfully.

Can anyone explain what might be happening here?


I suspect you are in a very specific corner case. Ctrl-J is the code for the Enter key (line feed) and so it seems screen is treating this specially.

I can type ls Ret and I get a directory listing. But now, sitting at the bare prompt, if I try to type just Ret nothing happens until I follow up with a j to send a literal line feed.

My strong recommendation would be to simply not try to use this particular key as the command key for screen. (My personal preference is ^L which doesn't clash much with anything useful; and typing ctrlL L on the rare occasions when I do need it is perfectly acceptable.)

| improve this answer | |
  • I don't see the behaviour you are describing re: the bare Ret character. Also, I have been using C-j as my control character for more than ten years. This means I will need some convincing to switch (especially as I get my desired behaviour by using C-j :escape ^Jj – Realraptor Apr 18 '18 at 8:41
  • Ooh: on my system C-v <ret> produces ^M, which explains the different behaviour from what tripleee describes. – Realraptor Apr 18 '18 at 8:42
  • The concrete Ret key traditionally produces ^M but on Unix this gets remapped to ^J. This also depends on your terminal settings. – tripleee Apr 18 '18 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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