How do I use the Control key while using Eshell to send that command to the remote server -- e.g., when creating a cat file and I need to press Control+d to save and exit, or when using Nano edit and I need to exit with Control+x.

  • Did you try to use C-q C-d? C-q is for "raw" insert. – Daimrod Apr 20 '14 at 1:58
  • @Daimrod -- thanks, I just tried, and that does indeed insert a raw ^D. In this particular case, however, I am hoping to send a command to cat that says -- "I'm done so please save and exit." On a regular terminal, C-d does just that. Emacs uses the Control key as a modifier, so I'm not sure how to temporarily disable the behavior of C-d or find another means of exiting out of cat. The same problem exists for other programs running in the terminal through Emacs (e.g., Eshell) that need a command beginning with the Control key followed by a letter. – lawlist Apr 20 '14 at 2:15
  • As I don't use Eshell I don't know if it's even possible with it. However, I know it works in term-mode (M-x term). – Daimrod Apr 21 '14 at 2:52

For the specific case of C-d, you can use C-c C-d, which is bound to eshell-send-eof-to-process. Otherwise, use C-q for quoted-insert, to force the following character to be inserted into the buffer even if it has a key binding in Emacs.

  • Yes, that works well -- thank you very much! :) – lawlist Apr 30 '14 at 15: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.