I am using shell in Emacs (M-x shell). Often, when I try to copy-paste a particular snippet of text from the output (say the output of a ls), I want to use ace-jump-mode to jump to a particular point on my screen but C-c+SPC seems to result to a new line and not prompt me for the head char. By using describe-key I get the following message:

C-c SPC runs the command comint-accumulate, which is an interactive compiled Lisp function. [...]

Why is the binding changed in the shell mode? In any other buffer describe-key shows the correct, anticipated binding for C-c SPC:

C-c SPC runs the command ace-jump-mode, which is an interactive Lisp function in `ace-jump-mode.el'.

How can I ensure that my ace jump bindings are not hijacked in shell ?


1 Answer 1


Here's my standard way to resolve this behavior. You can use it as a template for any mode:

(defun my-shell-hook ()
  (define-key shell-mode-map (kbd "C-c SPC") 'ace-jump-mode))

(add-hook 'shell-mode-hook 'my-shell-hook)

Although ace-jump-mode seems to misbehave when in shell, but that's a different problem.

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.