0

Working on source code in Emacs 28.2 on Mac, shell command M-! works as expected, and the command runs fine. The command M-x shell successfully launches a shell window, but then after running a shell command (such as ls -l), Emacs hangs. I have to force quit. I am running bash shell. I am also getting this behavior in Aquamacs. Any suggestions? Thanks.

6
  • 1
    Working on source code in Emacs 28.2... - what does that mean? Does it mean you built Emacs from source? When the shell window is launched, do you get a prompt where you type the ls -l or is there no prompt? Commented Jun 25, 2024 at 20:14
  • oh, sorry. I am just working in emacs writing some source code. I want to launch a shell window so I can compile the code there. Yes, I get a > prompt. The shell command runs. Then emacs is unresponsive...ESC, C-D, C-Z, C-C, nothing will nudge it, not even Quit Emacs from the menu bar. If I leave it for many minutes (not sure exactly how many), it gets unstuck. Commented Jun 26, 2024 at 0:41
  • Is this on Windows? Commented Jun 26, 2024 at 1:00
  • Does force quit mean you pressed C-g and that stopped the spinning? Commented Jun 26, 2024 at 14:58
  • No, on macos. Force quit via OPT-CMD-Shift. Commented Jun 29, 2024 at 16:44

1 Answer 1

0

I'd be willing to bet it's something with your shell's setup. Start with a reduced (or no) init, or disable fancy features. Very early in my ZSH init, at top of my ~/.zshrc I have:

 ## tramp gets hung up on precmd(), unset some features if [[ "$TERM" == "dumb" ]]; then unsetopt zle unsetopt prompt_cr unsetopt prompt_subst unfunction precmd unfunction preexec PS1='$ ' return fi 

Note the basic prompt, and that we bail out of initialization with the return. In fact, that's probably all you'd need for Bash.

1
  • Note, that I reference tramp in snippet's comment, but this would apply to M-x shell as well, as the both set TERM to "dumb". Commented Jul 1, 2024 at 19:13

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.