0

I'm using a program that expects to be able to read a character from the terminal as soon as it's pressed - i.e. presumably sets the terminal options so it's unbuffered*.

I don't seem to be able to get emacs's shell mode to be able to send just a character without a newline - e.g. to send a as opposed to a\n.

Any thoughts on how to get around this without stepping outside emacs and using a regular terminal?

* I know the best option would be to modify the program to accommodate other terminals, but I'd like something that works sooner rather than later

1
  • 2
    C-c C-d is bound to comint-send-eof which is the equivalent of typing C-d at a "normal" terminal. That should dispatch the current contents of the input buffer to whoever is waiting for input. Note that a second C-c C-d (or C-d at a "normal" terminal) would send an EOF with the input buffer empty which would normally terminate most programs.
    – NickD
    Commented Apr 25 at 11:50

2 Answers 2

1

shell is a shell, not a terminal. If you need terminal features, such as uncooked input, then use term instead.

1

I'm accepting @NickD's answer, added here so I can mark it as such:

C-c C-d is bound to comint-send-eof which is the equivalent of typing C-d at a "normal" terminal. That should dispatch the current contents of the input buffer to whoever is waiting for input. Note that a second C-c C-d (or C-d at a "normal" terminal) would send an EOF with the input buffer empty which would normally terminate most programs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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