pi over SSH
pi runs on your machine and does its work on a remote host, the shape of VS Code’s Remote-SSH (#488; the decision is ADR-006). The tools read, write, search and run commands on the remote. The terminal never crosses the link, and neither do your model credentials.
Start a remote session
/ssh dev@box:/srv/app
Or from your shell, straight into one: pi "/ssh dev@box:/srv/app".
The destination is whatever ssh accepts: user@host, or a Host alias
from ~/.ssh/config (jump hosts, keys and certificates come with it).
The path is read as scp reads it: /ssh dev@box, or dev@box:, opens
your home directory on the remote, and a relative or ~ path
(dev@box:src/app, dev@box:~/src/app) is under that home. A
subcommand’s name (status, reconnect, forward, forwards,
unforward) keeps its meaning, so a host by one of those names is written
with a colon: /ssh status: (#526). /ssh first checks that it can connect and that the
directory exists. If either fails, it says why and the current session is
unchanged. If both succeed, it continues your latest conversation for that
remote project, or starts one if there is none, and the status line shows
ssh dev@box:/srv/app. The hub’s Session tab shows the same line and the
ports forwarded (the hub, #545).
/ssh --new dev@box:/srv/app starts a fresh one, and
/ssh --resume dev@box:/srv/app (or -r) lists the remote project’s
recent sessions (up to 30 newest across the remote and this machine, with
timestamp, session name or first prompt, and size) so you can pick one — or
choose to start a new session, or cancel without switching — before
fetching only the selected session (#995). --new and --resume (-r)
cannot be combined. The latest conversation
is found as pi -c finds one: the session file written most recently
that holds a message, each file read only as far as its first message,
so how long a conversation has grown no longer adds to what /ssh reads
(#877).
A remote project’s conversations are kept by the destination and the path
as you typed them, so one directory opened two ways has two histories:
box:/data/code/app and dev@box:/home/dev/code/app are separate even
where a bind mount or a link makes them one directory. /ssh checks for
that (#876). After it connects it asks the remote whether any other
project it has opened on that host is this same directory, by device and
inode. If one is, and its latest conversation is more recent than the one
/ssh is about to enter, it warns:
pi-ssh: this directory has a more recent conversation under another name: box:/data/code/app (last used 2026-11-12). /ssh box:/data/code/app continues that one; this session is a separate history.
It then enters the session you asked for. Nothing is moved or merged, and
the warning stops once the name you use holds the more recent conversation.
The check waits at most two seconds for the remote and says nothing when
it gets no answer.
A remote project’s sessions are kept on the remote, where a pi running
there keeps them (Sessions and memory live on the remote), so pi -c on the box
continues them too. From a shell here, pi "/ssh dev@box:/srv/app" is the
one step back into one; pi -c here looks for sessions in the shell’s own
directory (#524).
That last point is a trap: quit an SSH session, run pi -c in the same
shell, and pi continues whatever local session that directory last had -
another project’s agent, with its history - because the SSH session is
filed under its remote, not under the shell’s directory. pi gives an
extension no say in which session -c picks, so pi-ssh says so instead
(#750). Each remote remembers the directory its session was entered from
and when it was last open. A local session that pi -c
continues then names the SSH sessions left from its directory, each with
the command that returns to it: a warning when one was left after this
local session was last used, which is the trap, and a note otherwise.
pi-ssh: this is a local session, last used 3 h ago, and not the one you last left
from this directory. pi continues the newest session filed under the directory it
starts in, and an SSH session is filed under its remote. Left from here:
ssh dev@box:/srv/app (left 4 min ago; /ssh dev@box:/srv/app returns to it).
It never switches for you. A session still open in another terminal is
not listed; one whose pi died is, from when it opened; one left more than
two weeks ago is not. A fresh pi, and a session picked with /resume
inside pi, say nothing. The record is left.json in the remote’s anchor.
Two terminals that run pi -c in one directory both open the same
session file, and pi takes no lock on it: open each in a directory of its
own, or return to each by its /ssh line.
-
/sshor/ssh status: what this session is connected to, and the remote’s Node and platform. -
/ssh reconnect: drop the connection and make a new one. Any tool call reconnects on its own after a dropped link; this is for when you want to know now. -
In a remote session,
/resumelists that project’s earlier sessions. Opening one reconnects.
Requirements. The remote is POSIX (Linux, macOS) with Node 22 or later on
its non-interactive PATH. Authentication is by key or agent: ssh runs
with BatchMode=yes, so a password prompt cannot reach pi. Nothing is
installed on the remote by hand. The helper answers file and process
calls, and two that say what a directory is: its identity (device and
inode) and the host’s mount table, from which a session’s messaging name
is worked out on the remote (agent names, #839). pi uploads one helper file, named by its
hash, into ~/.pi-ssh/. If the remote lacks rg or fd, pi uploads the
pinned builds there too. A command over ssh does not read ~/.bashrc, so
a Node that nvm, fnm or volta put on your interactive PATH is not on
this one. When node is not found, pi runs nvm’s default Node (nvm which
default, from $NVM_DIR or ~/.nvm), so an nvm install works with no
setting (#704). Otherwise the start fails with "node is not on dev@box’s
PATH, and it has no nvm default: …; set its full path as "node" in
~/.pi/agent/pi-ssh.json." That key is described under Ports; its
value is the Node’s full path on the remote, and when it is set pi runs
that path and searches no further.
What runs where
| On the remote | On your machine |
|---|---|
|
The UI, the model calls and every credential |
Monitors' commands and their |
Monitors' records (their output copy, stderr and action log); the helpers' own model calls |
Containment: where a path really lands is asked of the remote; the project’s sessions and memory, kept where a pi there keeps them (#915) |
A working copy of each session, plan drafts and approvals, the modes overlay, diagnostics, pi-remote’s phone link |
|
pi’s own files: an absolute path under |
A remote session works on the remote alone. A tool pi-ssh cannot send over
is refused rather than run here (#705): on Windows that is pi’s
powershell tool, which runs on the machine pi runs on. The model is told
so in the session’s prompt, and a call says to use bash, which runs on the
remote. An MCP server you configure is not a pi tool: its tools act where
that server runs, which for a local one is your machine.
The tools say what pi’s own tools say locally, byte for byte; parity tests
hold them to it, against the pi the workspace pins. grep and find are
pi 1.8.0’s (#1031): a glob is relative to the searched path (with find
anchoring relative path patterns at the searched directory and deciding
smart-case from the pattern), a leading ./ is ignored, context lines are
ripgrep’s own, a limit below 1 means 1, and the limit notice appears only
when one more result exists. A seat still on an older pi gets these from a
remote and its installed pi’s behaviour locally until it updates pi. bash
is the distribution’s only one (#511). It is
sequential, so a batch holding a bash call runs in the order written, as
pi-workflow requires. Locally it runs with pi’s shell settings
(shellPath, shellCommandPrefix), a project’s only when trusted. On Windows each command under pi < 1.8.0 (argv -c transport) is written
to a script file and sourced from it (#450): pi passed the command to Git Bash
as an argument, and Git Bash’s runtime (MSYS) halved backslashes in one, so
printf '%s' 'a\\nb' ran as if it said 'a\nb'. Under pi 1.8.0+
(commandTransport: "env" via PI_BASH_COMMAND, #1030), pi handles the
command transport natively without a temp file, while each command still runs
with PYTHON_BASIC_REPL=1 unless you set it (#711). Its stdin is the NUL
device, which Windows calls a terminal, so a python - with nothing to read
started Python 3.13’s new REPL, which loops on NUL printing tracebacks. The old
REPL reads end of file and exits. Paths in tool calls and results are the remote’s, and ~
is the remote’s home. Of your environment, only pi’s session markers
(PI_SESSION_ID, PI_PROVIDER, PI_MODEL, PI_REASONING_LEVEL) reach a
remote command, plus TERM, LANG, LC_* and COLUMNS. A GITLAB_TOKEN
or an ANTHROPIC_* here never does.
A bash or PowerShell call that prints more than 256 MB is ended, local or
remote, and its result says why (#717). pi keeps a result to its last
50 KB, but writes all of a longer output to a full-output log in the temp
directory (pi-bash-<id>.log, pi-powershell-<id>.log), and a command that
printed forever filled 157 GB that way. Once per process the logs older than
three days are removed, with the scripts of the Windows transport that a
killed session left behind, older than a day.
The anchor
pi keys sessions, trust and AGENTS.md by a directory on your machine.
A remote project gets one: the anchor,
~/.pi/agent/remotes/<host>/<path>-<hash>/. It holds remote.json
(the destination and the path) and a mirror of what pi and the agency
guidance read from a project:
-
AGENTS.md: the context file pi would load from each of the remote path’s directories,/down. That is the first ofAGENTS.override.md,AGENTS.md,AGENTS.MD,CLAUDE.mdandCLAUDE.MD, as pi’s own discovery picks it. Each one carries a comment naming its source. -
.pi/gadhs-guidance.md, when the remote has one.
The mirror copies nothing else. Language markers are no longer mirrored
(#492): the profiles load from the marker files on the remote, read in one
find per turn, and the empty markers an earlier version wrote are
removed. If a remote find fails transiently, the session keeps its last
known language profiles instead of blanking them for one turn (#983).
A remote session’s <cwd> and <gadhs-ssh> block are written through pi’s
structured systemPromptOptions (cwd and sections["gadhs-ssh"]) rather
than returning a replaced prompt, so mid-conversation section updates (mode,
memory, port forwards) travel as small system rows and keep the prompt cache
intact (#982, #983). A helper running in its own worktree gets an anchor inside this
one, under .gadhs-helpers/, which the mirror never touches. In particular, the remote project’s own pi
extensions, skills and prompts are not loaded: they would run here,
against the wrong filesystem. pi reads AGENTS.md when it creates a
session, so /ssh writes the mirror before switching. Every later session
start refreshes it, and if the remote’s AGENTS.md changed since the last
mirror, pi says so; /reload reads it.
Trust works as it does for a local checkout with the same files. pi asks
only when a project has .pi/settings.json, .pi/mcp.json,
.pi/extensions, .pi/skills, .pi/prompts, .pi/themes,
.pi/SYSTEM.md, .pi/APPEND_SYSTEM.md or .agents/skills, and the mirror
writes none of them.
So the remote’s AGENTS.md and .pi/gadhs-guidance.md steer agents here
exactly as they would if pi ran there.
Sessions and memory live on the remote
A remote project’s sessions are kept on the remote, in the folder a pi
running there files that directory’s sessions under
(~/.pi/agent/sessions/--srv-app--/ for /srv/app), so pi -c on the box
and /ssh from any machine continue the same conversations (#915). This
machine keeps a working copy of each in the anchor’s own session folder,
which is what pi opens and /resume lists. The two copies differ only in
their first line, whose working directory each side writes in its own
terms: the remote path there, the anchor here.
-
/sshfirst brings the session it is about to continue up to date: if the remote has more of it, or has it alone, that is fetched now, and the status line showsssh dev@box:/srv/app: fetching your last session, 1.4 of 3.2 MiB. Everything else waits for the session that opens. -
While the session runs, what it adds is sent after each turn, without holding the turn. When it starts, the remote’s other sessions are fetched and this machine’s are sent, in the background, newest first. At its end the last of it is sent, waiting at most five seconds.
-
Every move is an append at the size the other side last had. A write the other side did not expect is refused, never overwritten. A session continued both here and on the box keeps both histories: the remote’s version keeps the session, and this machine’s becomes a new session beside it, which
/resumelists./sshsays so:pi-ssh: 2026-11-24T10-00-00-000Z_….jsonl was continued both here and on dev@box. The remote's version keeps the session; this machine's is now 2026-11-24T18-02-11-410Z_….jsonl, which /resume lists.A session continued on the box while it is open here stops being sent (
pi-ssh: this session was continued on dev@box since it was opened here. …). What is added here stays on this machine, and the next/sshfiles it as a new session. -
The first
/sshafter updating sends every session this machine kept for the project, and says so once (pi-ssh: 7 session(s) kept only on this machine are now on dev@box (…)). A large history moves in the background, a megabyte at a time, and resumes after a cut. Helpers' transcripts go with their session, as they are, and are not fetched back. -
Files are written
0600in a folder made0700: a transcript holds whatever the session saw. A session in a format newer than this pi reads is not fetched, and a notice counts those. -
/ssh statussays where the sessions go and whether this one’s are in step:sessions: /home/dev/.pi/agent/sessions/--srv-app--, in step, or, 12 KiB not yet sent, or, not kept there:and why. -
If the remote’s pi directory cannot be read or written, the session works from this machine as before and says why; the next
/sshtries again.
Memory is the remote’s too: /remember, /memory, the remember and
forget tools and the notes in the prompt read and write the store a pi on
the box uses, gadhs-memory.json in its pi directory, with the keys it
uses (memory). The project’s pool is the remote
checkout’s, keyed by its origin as a local clone’s is, and the machine’s
pool is the remote host’s: a machine note in an SSH session is about the
machine the work runs on. Notes filed on this machine are not copied there.
Each turn reads the store once; the session’s first also finds the
remote’s keys. A remote that does not answer within five seconds, at any of
those steps, keeps the session’s last known notes for that turn instead of
blanking the gadhs-memory section (#983), or injects none when no notes
have been read yet, said once until it answers again
(memory: dev@box:/srv/app did not answer; keeping last notes this turn. or
no notes this turn.). A store a
pi of an earlier release left there is not converted from here; start pi
on the box once.
Helpers, monitors, count and images
A remote session’s helpers, monitors and tools work where the code is (#492).
-
Helpers in their own worktree (
worktreeAgents, Helpers) get one on the remote. It is a directory from the remote’smktemp -dand a branchhelper/<type>-<id>. The helper runs in a workspace of its own over the same connection, so its tools, commits and asks act in its worktree. When it finishes, its result says where the work is. A worktree that holds no change and no commit is removed shortly after, with its branch. One with work is kept for you to merge or open an MR from, and the next session on that remote names it at its first turn (#503). -
Monitors run their command, and any
on_matchaction, on the remote inbash -lc, as thebashtool does. Only pi’s session markers and the event’s variables reach them. A stop ends the whole remote process group. On a resilient link a dropped link does not end it: its command runs on, and its events resume when the link comes back (A dropped link). If pi gives up reconnecting, the command’s stream ends as an exit with no code, and the monitor with it, as at any exit. -
Jobs run on the remote, and live there (#671): their records, logs and exit files are under the remote’s
~/.pi-ssh/jobs, where any later session on that remote, from any machine, finds them. That is the contrast with a monitor, whose records stay here. A job is started outside the helper, so neither a goodbye, a/reloadnor the daemon’s idle end stops it;job_stopdoes (Jobs on a remote). -
countwalks the remote checkout. pi’s own files, an absolute path under pi’s agent directory, are counted on this machine, as the file tools read them. From Windows, any other local drive or UNC path is refused with the reason (#525). A remote count of a tree equals a local count of the same tree: the same skips, limits and numbers.~is the remote’s home, as the file tools take it, and the name glob keeps case, as a POSIX filesystem does (#537). -
generate_imagereads reference images from the remote and saves there. Its refusals are decided on the remote: a path through a link out of the remote tree,.git, a credential-shaped name, an existing file.
Safeguards
-
Containment is decided on the remote. The workspace-write and workspace-read stages, and the rule for a redirect’s destination, follow every symlink where the symlinks are. A link in the remote tree pointing out, or
link/..through one, is refused deterministically in auto byoutsideWritesand judged elsewhere (Workflow Modes,workspaceWrites,outsideWrites). A path under the anchor is read as the remote path it stands for. So the rules protect the remote project’s.pi/as they protect a local one’s. -
A commit is guarded as a local one is (#491). The commit guard, the cold review, its snapshot and declared context, the review rules, the approved-plan check and the authoring guard all read the remote checkout, through the same connection. The verdict and the trailers are what they would be for the same index locally. If the link is down, the staged state is unknown and the commit is held, never passed.
-
No silent local fallback. A lost link fails each call with the reason until the next call reconnects. A session in an anchor that has no connection (the start could not set one up, or a helper outlived its parent) refuses every tool call and every
!. Nothing runs on the anchor’s files instead. -
The judge knows. Its facts name the workspace as
dev@box:/srv/app (over SSH; …), and the origin, branch and push destination are read from the remote checkout. A path-form origin (~/x.git,/srv/x.git) is local only when that directory exists on the remote. If the remote cannot be asked, a push’s destination is a network host, so the shared-branch rules hold.
Limitations
-
Key or agent authentication only; a password prompt cannot reach pi.
-
The check for the same directory under another name (#876) looks only at projects opened under the same host name. The same machine reached by an address or by another
Hostalias is not seen, nor is a directory the remote user may not look at, nor more than 64 other projects on one host. Where it was counted, 5 of 5 doubled directories were under one host name. Two machines that share a host name could be confused; the warning only names a command. -
A remote helper’s worktree is not decided at once. pi-subagents ends a helper synchronously, before the remote can be asked, so the result says where the work is and the empty-worktree removal follows in the background. A local helper’s result says which happened.
-
countreads every file it counts across the link, within its limits (5000 files, 5 MiB each). -
Monitors' records stay on this machine while their commands run on the remote; a job’s are on the remote.
-
glab,git pushand anything else the remote runs use the remote’s own credentials. Its hooks run with its own tools. -
The remote project’s pi extensions, skills and prompts are not loaded.
-
Every operation is a round trip (What each operation costs). Containment adds one to each read it decides and to a write over a file that exists, three to a write of a new file, and two more for each directory such a write creates. A guarded commit costs on the order of ten, plus the reviewer’s own reads. On a slow link, pi is slower than one running on the remote.
-
A helper’s system prompt says it is not in a git repository and names no branch. pi-subagents finds both with a local
gitin the helper’s directory, which in a remote session is an anchor on this machine. This is cosmetic: the helper’s tools and the commit guard read the remote checkout, branch included. The same block’s working directory, which pi-subagents also takes from the anchor, is rewritten to the remote root before the helper starts, as the session’s own is (#518). -
Plan drafts are local. Two machines running pi against the same remote do not share them; they share the project’s sessions and memory (Sessions and memory live on the remote).
-
Sessions are kept where a pi on the box would look for them only when that pi computes the same agent directory:
PI_CODING_AGENT_DIRas ssh’s non-interactive login sees it, else~/.pi/agent. A shell profile that sets it for interactive shells only puts the box’s pi elsewhere;/ssh statusnames the folder the sessions go to. A pi on the box older than this one may not read a session this one wrote; update both. -
A session of a subdirectory of the remote path is filed by a pi there under that subdirectory, and is not kept in step.
-
A write in flight at the instant the link drops is unknown, since the remote may or may not have done it. It fails, and the caller reads before trying again. Interactive programs still do not work.
-
The daemon ends ten minutes after its last client leaves without a goodbye, killing any command still running then. While pi runs, it is that client, so a monitor is kept.
-
A daemon that holds nothing stays five minutes after a connection is lost without a goodbye (
GADHS_PI_SSH_DROP_LINGER_MS), so a reconnect finds the same one: a command whose request never reached it is then sent again, where a new daemon would have had it reported lost (#800). -
While the link is down, a command keeps its last 1 MiB of output for the replay. Past that, its result shows how many bytes were lost.
-
Those limits are the helper’s defaults, and its environment on the remote can change each:
GADHS_PI_SSH_IDLE_MS(600 000, the daemon’s idle end),GADHS_PI_SSH_RESUME_BYTES(1 MiB, the replay),GADHS_PI_SSH_FINISHED_KEEP_MS(300 000, how long a finished command’s result waits for its client) andGADHS_PI_SSH_DAEMON_START_MS(5 000, how long a connect waits for a daemon it started). A value that is not a positive number keeps the default (helper.mjs). -
Forwards are TCP, from this machine to the remote only: no reverse forwards, no UDP, no Unix sockets. Each forward is its own ssh connection, and so its own authentication.
-
The remote host is POSIX. A Windows remote is out of scope; a Windows machine running pi is in scope (see From a Windows machine).
A dropped link
A Wi-Fi drop no longer kills what runs on the remote (#493). On the
remote, pi’s helper runs as a daemon of your user, reached on a Unix
socket in ~/.pi-ssh that only you can open (or under a mode-0700
user-private /tmp/pi-ssh-<uid>/ directory keyed by the socket path’s
SHA-256 when ~/.pi-ssh/daemon-<hash>.sock would exceed the OS sun_path
limit, such as 104 bytes on macOS, #1006). Each ssh connection
relays to it. When the link drops:
-
A running command, a spawned program or a monitor goes on. Its output is kept, and pi reconnects on its own, up to five times over about 30 seconds. The output then arrives from where it left off, once and in order.
-
A read that was waiting for an answer is asked again. A write that was waiting is reported as failed, because it may or may not have happened; nothing is done twice behind your back.
-
If the daemon itself was restarted meanwhile, a command it no longer knows ends with "the command’s output was lost with the connection". It is never run again on its own.
-
If pi gives up reconnecting, what was waiting fails as before. The next call connects afresh.
When pi exits normally it says goodbye, and the daemon ends what that
session started. /reload does the same: it shuts the session down and
starts it again, so a command, program or monitor running on the remote
at that moment ends, and the next call meets a new daemon. Seen live from
a Windows client: no remote process outlived it (#459). Reload when
nothing is running there. A job is the exception: it is not the daemon’s
child, so the daemon’s end does not end it (#671). If no daemon can start on the remote (no writable home,
say), pi serves on the ssh connection itself, and a drop fails what was
running. /ssh status says which: "link: resilient"
or "link: not resilient".
What each operation costs
pi’s own overhead per operation, measured on one machine through the helper, so with no network in it. Over ssh, add one network round trip to each.
| Operation | stdio, median | stdio, 95th | daemon, median | daemon, 95th |
|---|---|---|---|---|
|
0.016 ms |
0.030 ms |
0.031 ms |
0.094 ms |
|
0.027 ms |
0.063 ms |
0.047 ms |
0.174 ms |
|
0.024 ms |
0.087 ms |
0.032 ms |
0.100 ms |
|
0.015 ms |
0.022 ms |
0.019 ms |
0.029 ms |
|
0.80 ms |
1.0 ms |
0.77 ms |
1.1 ms |
A drop, to a call answered again |
n/a |
n/a |
29 ms |
30 ms |
The relay adds a few hundredths of a millisecond. A drop costs about 30 ms locally, plus starting ssh again on a real link. These are 300 calls each, on Node 26, through pi-ssh’s own test transport.
On a LAN link, a Windows client to a Linux host over Wi-Fi (IPv6 link-local) on 0.137.0, with the host loaded (load average 10-16), timed from inside the session in auto mode (#512). Each figure is a whole tool call as the agent sees it, the permission check included: a call a rule allows costs only the link, and a call the judge decides adds the judge’s round trip.
| Tool call | median | range |
|---|---|---|
|
23 ms |
21-39 ms |
|
870 ms |
667-1,341 ms |
|
751 ms |
666-823 ms |
|
874 ms |
770-1,117 ms |
|
1,354 ms |
1,323-1,372 ms |
|
1,220 ms |
1,207-1,749 ms |
|
3,330 ms |
3,239-7,309 ms |
The difference between true and stat, the same transport, is the
judge. The gate and the transport are not separated for the other rows.
These are the figures pi publishes; no WAN figures are planned (#512). A
slower link adds its round trip to each call, so the link’s own figure,
bash true allowed by rule, is the one to measure. To measure yours, time
the same calls from inside a session connected to the host, for example a
few bash true and a read of a small file. pi connects when the
session starts, so the first call pays no setup; a call after a drop
pays starting ssh again, as in the drop row above.
Ports
A dev server on the remote can be opened here (#493).
-
/ssh forward 3000makes the remote’s port 3000 reachable athttp://127.0.0.1:3000on this machine./ssh forward 3000:8080uses local port 8080 instead. Each forward is anssh -N -Lconnection with the session’s destination, in batch mode. A local port already in use, or one ssh cannot bind, is refused with the reason. Nothing is listed as live then. -
/ssh forwardslists them, each with its state. A forward whose ssh ended says why./ssh unforward 3000stops one. They all stop when the session ends. -
pi watches the remote’s listening TCP ports, every two seconds, with
ssor, failing that,/proc/net. Ports already listening when the session connects are its baseline. A port that starts listening after that is named, with the command that opened it: "port 3000 is listening on the remote (node server.js);/ssh forward 3000`". A remote with neither `ssnor/proc/net(not Linux) says so once;/ssh forwardstill works there. -
With
"autoForward": truein~/.pi/agent/pi-ssh.json, such a port is forwarded at once and its URL named. Ports below 1024, and the remote’s sshd port, are only ever named. -
The agent is told which ports are forwarded, so it can point you at the right local URL. It cannot start a forward itself; ask, or run
/ssh forward.
~/.pi/agent/pi-ssh.json holds pi-ssh’s own settings: autoForward, and
node, the remote’s Node path when it is not node on the remote’s
non-interactive PATH. Only this file counts; a repository’s files
cannot set either. If it is invalid, pi says which key is wrong and starts
no remote until it is fixed. A session already in an anchor then refuses
its tools rather than acting on the anchor’s files.
From a Windows machine
pi runs on Windows against a POSIX remote (#501, #505). pi’s read,
write, edit and ls resolve a path with this machine’s rules before
pi-ssh sees it. On Windows those rules gave a rooted path with no drive
the drive of pi’s working directory, so src/x.ts reached the remote as
C:\home\me\app\src\x.ts. pi-ssh now hands those tools the remote root
on a drive letter that does not exist on this machine, the highest free
one from Z: down: Z:\home\me\app. Windows' rules keep that drive, and
pi-ssh turns every path back into the remote’s before it is used.
pi resolves a rooted path on its own and never against that root, so
/etc/hosts would still land on pi’s drive as C:\etc\hosts, and be
refused. pi-ssh therefore spells a rooted path on the same letter before
pi’s tool sees it (Z:/etc/hosts), and ~/x likewise once it has been
read as the remote’s home (#516). So:
-
src/x.ts,/etc/hostsand../otherare the remote paths they name, and so is a name shaped like a drive,q:notes.txt(#521). -
A path under the anchor is the remote path it stands for.
-
Any other Windows path (
C:\Users\me\Desktop\x,\\server\share) is a file on this machine named by mistake. It is refused as missing, with the reason, and nothing is looked for on the remote. -
A path already on that letter (
Z:/home/me/app/x.ts, asreadandlstake it) is the remote path to every tool,count,grepandfindincluded (#543).countrefused it as a Windows path, andgrepandfindjoined it onto the remote root as a relative name. The other rules above hold for them too: an anchor path maps, and any other Windows path is refused with the reason.
Results and errors name the remote’s paths, never the drive letter,
whichever slash the path came with (pi’s write and edit echo Q:/home/…)
and whatever spaces it holds. A quoted path runs to its closing quote; an
unquoted one to its line’s end, a sentence mark before a space, or the next
such path (#532).
bash was already unaffected. If every drive letter
is in use on this machine, the file tools refuse and say so; unmap one.
A remote name holding a backslash stays out of the file tools' reach
from Windows, because they read paths with Windows' rules: read
hunt/a\b.txt looks for hunt/a/b.txt (#520). Reach it through bash:
cat 'hunt/a\b.txt'.
Turning it off
GADHS_PI_SSH=off in pi’s environment loads none of it. /ssh is gone, and
the tools are pi’s own. A session already opened in an anchor is then an
ordinary local session in that directory, whose tools act on the anchor’s
mirror rather than the remote. So leave such a session before turning
pi over SSH off.