Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6092649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:28:01+00:00 2026-05-23T12:28:01+00:00

In shell mode on emacs, the current key binding for quitting the shell mode

  • 0

In shell mode on emacs, the current key binding for quitting the shell mode ('comint-interrupt-subjob) is "\C-c \C-c", and I want to change it to "\C-c" as in ordinary linux shell. I tried

(add-hook 'shell-mode-hook '(lambda ()
  (local-set-key "\C-c" 'comint-interrupt-subjob)
))

But it did not work. Probably I need to disable the prefix assigned to "\C-c". How can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:28:02+00:00Added an answer on May 23, 2026 at 12:28 pm

    Try this:

    (eval-after-load "shell"
      '(define-key shell-mode-map (kbd "C-c") 'comint-interrupt-subjob))
    

    In general, when you define keys you should define them in particular keymaps, as opposed to just hoping the local-set-key does what you want.

    Note: I prefer using kbd for describing keys, your "\C-c" would work just fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My current use pattern of emacs results in my having several shell-mode buffers open,
I like to use Emacs' shell mode, but it has a few deficiencies. One
In sh-mode in Emacs, I was looking for a way to execute a shell
I use Ubuntu8.10 and emacs-snapshot. Running shell-mode on emacs and input ls shows escape
Can I use powershell as the shell, in shell mode for emacs? How?
for Emacs you can define your shell-mode aliases in .emacs.d/init_bash.sh, but Aquamacs (2.0 on
I'm an avid Emacs user and love shell-mode that in my opinion brings the
In GNU Emacs, I want to run a program, figlet, on the currently selected
I use python debugger pdb. I use emacs for python programming. I use python-mode.el.
when i try to make a git commit in emacs eshell mode: git commit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.