commit c46b0baa089608a16ab9ac71a2d8dfeea92422f0 parent 11d46fa9c7089a85d8818fb2bd0eeae0baadc812 Author: Kévin Le Gouguec <kevin.legouguec@gmail.com> Date: Sat, 27 Nov 2021 23:19:20 +0100 Expand on shell-mode itch Diffstat:
| M | itches/emacs/interpreters.org | | | 23 | ++++++++++++++++++++++- |
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/itches/emacs/interpreters.org b/itches/emacs/interpreters.org @@ -1,6 +1,27 @@ * Shell ** Add faces instead of reusing font-lock-{comment,string}. -** Understand ~autocd~ and ~cd !$~. +** Improve directory tracking. +Ensure ~default-directory~ remains consistent with the shell's current +working directory. Some things ~shell-mode~ does not handle: + +- ~autocd~ (there's ~shell-has-auto-cd~, but it does not track whether + ~autocd~ is *actually* set) +- ~cd !$~ +- ~ssh~ +- Docker containers + +Some solutions: +- Emacs 28's ~comint-osc-process-output~ + - requires configuring the prompt + - does not handle SSH (yet) + - relies on OSC 7, which is [[https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/20][not standard yet]] +- running this clumsy thing after every command: + #+begin_src sh + (file-truename + (format "/proc/%d/cwd" + (process-id (get-buffer-process (current-buffer))))) + #+end_src + ** Use Bash completions. E.g. in most terminals, typing ~ls TAB~ in a folder with a single file expands to ~ls that-file~.