apparent solution to Emacs multi-shell problem

Ken Brown kbrown@cornell.edu
Wed Aug 14 15:29:15 GMT 2024


On 8/11/2024 2:35 PM, Brian Inglis via Cygwin wrote:
> [Added Emacs to Subject to get appropriate attention]
> 
> On 2024-08-11 11:22, KARR, DAVID via Cygwin wrote:
>> So then I looked at my .emacs file, and I noticed the following.  Note 
>> that this is another block of code that I haven't changed in many 
>> years. I know that several of these lines are obsolete now, even some 
>> that aren't causing my problem:
>> ------------------
>> (defun my-shell-mode-hook ()
>> ;(add-hook 'comint-output-filter-functions
>> ;        'shell-strip-ctrl-m nil t)
>>    (add-hook 'comint-output-filter-functions
>>         'comint-watch-for-password-prompt nil t)
>>    (setq explicit-shell-file-name "bash")
>>    ;; For subprocesses invoked via the shell
>>    ;; (e.g., "shell -c command")
>>    (setq shell-file-name explicit-shell-file-name)
>>    (ansi-color-for-comint-mode-on)
>>    (shell-strip-ctrl-m)
>>    (setq shell-prompt-pattern "^\[[A-z0-9]+:[A-z0-9/]+\] ")
>>    (local-set-key "\C-xs" 'cycle-go-shell)
>>    (local-set-key "\C-xS" 'cycle-find-shell-or-shells-buffer-list)
>>    (local-set-key "\C-j" 'lfd-send-input)
>>    (local-set-key [f5] 'comint-previous-matching-input-from-input)
>>    (local-set-key [f12] 'compilation-shell-minor-mode)
>>    )
>> -----------------
>>
>> For most of this, I can't even remember what it was for.  I tried 
>> commenting out portions of this and retesting, and I finally narrowed 
>> it down to the two sets of the related "file-name" variables. When I 
>> comment both of those out and retest, the problem doesn't occur.  I 
>> see that the new value of "shell-file-name" is "/bin/bash", instead of 
>> the "bash" value that I was hardcoding before.  Certainly less code is 
>> better than more code, especially if it works, but it would be useful 
>> to understand if something changed recently that might have caused 
>> that error.

Sorry, but I have no idea.  I'm not aware of anything that's changed in 
Emacs that would explain this.

>> I also briefly examined some of these other blocks, and I see that 
>> apparently "shell-strip-ctrl-m" is obsolete.  Is it best to have this?:
>>
>>      (add-hook 'comint-output-filter-functions
>>     'comint-strip-ctrl-m nil t)

I don't know of any reason you would need that.  I've never done 
anything like that myself.

Ken


More information about the Cygwin mailing list