DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 47BIahCK2340061 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=BxbHdb4U X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CCC8385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1723401401; bh=uA7l2M6yWS1zC/EEYYvvf47Fif5ReMomWKmafSXhPeQ=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BxbHdb4UrlPDdgRn4mXgNpWObGVYGRJlgiK7OZ1a5F/eHfUTaF4Ps6eAQDjEWM55d zAukb3afViybQ2Heb8HwdikuHAguTsGR0hbFd3PtvlRfdDLJJHKUGYfDfbAFJtG8dz jOqOZOtmiw5CpVx7oKFVEjgeAqfWqOU1E3EyPEuM= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D46D3858D34 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7D46D3858D34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723401344; cv=none; b=mY/ZiEEB7L+Nk7O/eqy40rXihKFHH40ZGZ8HQtrheGf9OL4HD2gCtH0rpxag8vAyQ0SbLSZMUICooxvLl4UXR+UzGj7PUnQc7T9K4QMQXxoydUX/dicuJ4N8dUxWeyu/YkUNW7d3cGOk2NWgi+cBTLnZVur/dHmn/NQ4ltRFTSA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723401344; c=relaxed/simple; bh=kH87BY7wPx/GfX1u2C2NYgz+W4CgKHohw6Ji2qR8hPw=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=Y6gbgG3RvrJOYJSgpxKbSjjEjh8PHY/rK3zECTLqfLFswvViDk7/opdz9uR+X006cQWmCxzkc2zJlifvgO52zzDaNvM9I2ge9hgpCQdrdrWmko2e9IVXWeV5dFFzWidpEyzDkOQYBsrlEFYlP1hqs7t3LJIKoLC17phF5aHprec= ARC-Authentication-Results: i=1; server2.sourceware.org Message-ID: <9b9c02ae-36da-410f-bf96-523a036f724c@SystematicSW.ab.ca> Date: Sun, 11 Aug 2024 12:35:39 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: apparent solution to Emacs multi-shell problem Content-Language: en-CA To: cygwin AT cygwin DOT com References: Organization: Systematic Software In-Reply-To: X-Rspamd-Queue-Id: B146C6000B X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Rspamd-Server: rspamout06 X-Stat-Signature: 3qqruknky6p7h8oddkxmiufe78doneqz X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 X-Session-ID: U2FsdGVkX1/Q4SlaYm4osnXInU+YVezV0IF8fGyweC0= X-HE-Tag: 1723401340-941267 X-HE-Meta: U2FsdGVkX18NPNzfRumJ9HJmw6RcJhysyDWxPEW9eQfe8sVckQWP9pF4z5ZsACIOrn/iJXUqBw7esslQV0INi+u4zBA22iXk6GLthQKcj+YBog3Ym9hy8BMb2CdumCw8VSSupg3oLJxH6fh3XcMgE3B3MFFdEn8T2chtv9iJJFgFrW3M917lZoH3Qav2PE+L/1vyPwA0te+fCE35zsSBCoLzIOt2Sh/8PNnXwL7/HBJ9W0+BeHweBIlVbPQfI75CDetne0jQMIgGwVHpnEJ/nzznyf0Kb83UXgO/whvP8nIrHd2bADcfpBc05L8sAjNvKAA1bsOIMHC67DYlM86FUtPexYOEpi9n X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Brian Inglis via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Brian Inglis Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 47BIahCK2340061 [Added Emacs to Subject to get appropriate attention] On 2024-08-11 11:22, KARR, DAVID via Cygwin wrote: > This is a repost with additional information. I've managed to find a fix, but I'd like to understand what happened, and perhaps clean up some ancient code. > > For the last few days, I've been struggling with a problem with Cygwin Emacs after reinstalling Cygwin, which I haven't had to do for a while. > > I discovered that when I create the first shell buffer, it works fine. When I create the second shell buffer, it fails with this: > ------------------ > bash: cannot set terminal process group (-1): Inappropriate ioctl for device > bash: no job control in this shell > ---------------- > > After I got away from the computer for a while, I realized that I might be able to narrow this down. I thought that this might be a problem with the small façade package I wrote over "shell" a few decades ago, but I realized that if I just start Emacs and manually switch to a buffer and run "shell" and then do that again, that is basically the same thing. I found that that repeats the problem. > > 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. > > 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) -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple