0

I've asked this question: Emacs opens gitbash in new system window

the solution make git bash run on windows but prompt was not read only. I've applied this solution Any way to make prompts and previous-output uneditable in shell/term-mode?

It works. I can type and prompt is read only, but I can't type enter to send command I've just typed into bash.

How can I make enter work in shell on Windows?

So far I have this code:

(setq explicit-shell-file-name "C:/Users/jankiewj/AppData/Local/Programs/Git/bin/bash.exe")
(setq shell-file-name explicit-shell-file-name)
(setq explicit-bash.exe-args '("--login" "-i"))

(setq comint-prompt-read-only t)

(defun my-comint-preoutput-turn-buffer-read-only (text)
  (propertize text 'read-only t))

(add-hook 'comint-preoutput-filter-functions 'my-comint-preoutput-turn-buffer-read-only)

And I'm executing M-x shell which open shell in new window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.