[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion c99083233f 241/313: Fix shell-type detecti
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion c99083233f 241/313: Fix shell-type detection logic for remote processes. |
Date: |
Sat, 3 Dec 2022 10:59:34 -0500 (EST) |
branch: elpa/bash-completion
commit c99083233fd8e9d39eec3314f6d00450e029af86
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Fix shell-type detection logic for remote processes.
(bash-completion--current-shell) reproduces the logic used by
shell-mode when figuring out what type of shell it's starting to
tell bash from other shells.
---
bash-completion.el | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 02f591bbce..0f862949a8 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -153,6 +153,7 @@
(require 'comint)
(require 'cl-lib)
+(require 'shell)
;;; ---------- Customization
(defgroup bash-completion nil
@@ -1172,6 +1173,19 @@ is set to t."
(bash-completion-kill process)
(error nil)))))))))
+(defun bash-completion--current-shell ()
+ "Figure out what the shell associated with the current buffer is."
+ (let ((prog (or
+ (if (derived-mode-p 'shell-mode)
+ (or explicit-shell-file-name
+ (getenv "ESHELL")
+ shell-file-name))
+ (let ((process (get-buffer-process (current-buffer))))
+ (when process
+ (car (process-command process)))))))
+ (when prog
+ (file-name-nondirectory prog))))
+
(defun bash-completion--get-same-process ()
"Return the BASH process associated with the current buffer.
@@ -1181,8 +1195,8 @@ Completion will fallback to creating a separate process
completion in these cases."
(when (derived-mode-p 'comint-mode)
(let* ((process (get-buffer-process (current-buffer)))
- (command (when process (file-name-nondirectory (car
(process-command process))))))
- (when (and command (bash-completion-starts-with command "bash"))
+ (shell (if process (bash-completion--current-shell))))
+ (when (and shell (bash-completion-starts-with shell "bash"))
(unless (process-get process 'setup-done)
(bash-completion--setup-bash-common process))
process))))
- [nongnu] elpa/bash-completion 0a6fa499ad 207/313: Fix one parameter name of bash-completion--wait-for-prompt, (continued)
- [nongnu] elpa/bash-completion 0a6fa499ad 207/313: Fix one parameter name of bash-completion--wait-for-prompt, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3bd30eea3f 208/313: Use the correct function to send string to completion process, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fd2f8e277e 211/313: Improve prompt detection, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ac3bd404e8 220/313: Fix typos (#40), ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f31bb46ff4 222/313: Making sure that line editing is turned off (#42), ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3210a44081 224/313: Makefile allows specifying the path to bash., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2178030cdf 225/313: Allow running unit and integration tests separately., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c564aff656 229/313: Add workflow for testing on MacOS with BASH 3., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ba8be293a4 226/313: Added test workflow to run tests on multiple versions of Emacs., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0a757bd5f4 238/313: Test calling completion from non-comint and non-bash shell buffers., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c99083233f 241/313: Fix shell-type detection logic for remote processes.,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 4a1d89f01e 246/313: Support -o vi and emacs even in single-process mode., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion aec357fbf1 249/313: Test default completion with both value of use-separate-process., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 38c82e5d59 252/313: Conserve quotes even when expanding case-insensitively., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6a66eeda45 253/313: Add test-case to cover tilde and tilde expansion., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b9e519e2ad 263/313: Fix typo, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2684ea9e46 264/313: Fix issue with case-insensitive completion., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6d74dd30ba 266/313: Avoid interference from PROMPT_COMMAND in single process mode., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 23a3402844 270/313: Trying to disable the warning on MacOS that breaks the tests., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1598101f06 271/313: Remove the fallback to a separate process., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 18ed1504ce 274/313: Add test cases for TRAMP shell., ELPA Syncer, 2022/12/03