From bc5e6b6117cbe4dc95fa19d7bcdb16d66543385a Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Thu, 10 Sep 2026 13:58:29 +0800 Subject: [PATCH] docs: correct the nested-shell cwd notes against the code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The oh-my-zsh guard is not at the top of `lib/termsupport.zsh` — it fences off the cwd reporter at the end of the file, and the title hooks above it keep running over SSH. Say that instead. The list under "the shell is one tty7 does not integrate" is the set it *does* integrate, which read as its own opposite; turn the sentence around. Nushell has had the integration since #637 (`ShellKind::Nushell`, a `nu --config` wrapper), so give it a row in the shells table and stop listing it among the shells that have none. The per-profile toggle lives behind **Advanced**, as `docs/remote/ssh.mdx` and the section below already say, and the panel is the **Files** panel everywhere else in these docs. Claude-Session: https://claude.ai/code/session_01JRqYZ9E153WpSHGS2AW3BM --- docs/reference/shell-integration.mdx | 5 +++-- docs/reference/troubleshooting.mdx | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/reference/shell-integration.mdx b/docs/reference/shell-integration.mdx index ee162243..9f327dbc 100644 --- a/docs/reference/shell-integration.mdx +++ b/docs/reference/shell-integration.mdx @@ -19,8 +19,9 @@ removes itself from the equation if you run the same shell elsewhere. | **bash** | An rcfile that sources your own first. | | **fish** | A `-C` init command. | | **PowerShell** | An encoded init command that wraps your existing `prompt` function and PSReadLine's line reader. | +| **nushell** | A `--config` wrapper whose `config.nu` sources yours first, then adds tty7's hooks. Local panes only. | | **WSL** *(Windows)* | The distro's shell is bootstrapped with the same scripts. | -| **Remote panes** | The same three POSIX shells, bootstrapped over the SSH connection. Toggle per profile with **Settings → SSH → Session → Shell integration**. | +| **Remote panes** | The same three POSIX shells, bootstrapped over the SSH connection. Toggle per profile with **Settings → SSH →** a profile **→ Advanced → Session → Shell integration**. | `TTY7_SHELL_INTEGRATION` is set once it is active, and guards against a second injection when shells nest. It does not put the integration *into* a nested @@ -92,7 +93,7 @@ To get integration into that shell, make it the shell tty7 starts: - **A local pane.** Set `shell` in [config](/reference/configuration), and leave `args` out — arguments you write turn the injection off. -[If the file panel stopped following a nested shell →](/reference/troubleshooting#the-directory-stopped-following-my-shell) +[If the Files panel stopped following a nested shell →](/reference/troubleshooting#the-directory-stopped-following-my-shell) ## Per-pane history diff --git a/docs/reference/troubleshooting.mdx b/docs/reference/troubleshooting.mdx index 3b9d3a99..ee5b40bc 100644 --- a/docs/reference/troubleshooting.mdx +++ b/docs/reference/troubleshooting.mdx @@ -81,12 +81,12 @@ shell: - **Settings → Input → Prompt → History search** If they do nothing at all in a particular pane, the shell there probably has no -[shell integration](/reference/shell-integration) — nushell, elvish, xonsh and -friends run fine but do not get the prompt layer. +[shell integration](/reference/shell-integration) — elvish, xonsh and friends +run fine but do not get the prompt layer. ## The directory stopped following my shell -The file panel, new splits, and the sidebar's repo grouping all follow the +The Files panel, new splits, and the sidebar's repo grouping all follow the directory the pane's shell reports (`OSC 7`). If the pane is frozen on one directory while you `cd` around, something in the pane is not reporting it. @@ -94,7 +94,8 @@ The usual cause is a shell you started by hand. tty7 injects its [shell integration](/reference/shell-integration) into the shell it launches for the pane, and nothing else: run `zsh` at a bash prompt and that nested shell has none. Locally you rarely notice, because oh-my-zsh reports the -directory itself — but its `lib/termsupport.zsh` begins with +directory itself — but the cwd reporter sits at the end of its +`lib/termsupport.zsh`, behind ```zsh if [[ -n "$INSIDE_EMACS" || -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then @@ -102,9 +103,10 @@ if [[ -n "$INSIDE_EMACS" || -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then fi ``` -so over SSH, where sshd sets those, oh-my-zsh does not define the reporter at -all. A nested zsh on a remote host therefore reports nothing, from either -side, and the pane keeps showing wherever the outer shell was. +so over SSH, where sshd sets those, sourcing stops there and the reporter is +never defined — only the title hooks above that line still run. A nested zsh +on a remote host therefore reports nothing, from either side, and the pane +keeps showing wherever the outer shell was. **Make it the shell tty7 starts.** On the remote host: @@ -140,9 +142,9 @@ PROMPT_COMMAND="__tty7_cwd${PROMPT_COMMAND:+;$PROMPT_COMMAND}" Two other reasons a pane never reports its directory: -- **The shell is one tty7 does not integrate.** Locally: zsh, bash, fish, - PowerShell, nushell. Over SSH: zsh, bash, fish. A remote host whose - `$SHELL` is anything else gets no bootstrap, silently. +- **The shell is not one tty7 integrates.** It injects into zsh, bash, fish, + PowerShell and nushell locally, and into zsh, bash and fish over SSH — a + remote host whose `$SHELL` is anything else gets no bootstrap, silently. - **You gave the shell your own arguments** in `shell` or a `custom_shells` entry, which turns the injection off by design.