From 12c257e624d3f1f80ca3df041b54026ff772d638 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 14:53:46 -0300 Subject: A path typed with a leading ~ is the home directory, at every entry point that takes one, through one helper Only DumpDir (dump.zig) and ShaderBuild expanded `~/`, each its own way. So a look at `~/notes.txt`, `name ~/x`, `Save ~/x`, ThemeFile, Restore and a quoted `pardes '~/x'` all took `~` as a directory of that name under the pane's. There is now one rule, filesystem.expandHome. A leading `~`, alone or before `/` or `:`, is $HOME, else the passwd entry's home; `~user` is that user's (getpwnam). As in a shell, it applies even beside a file named `~`, and `./~` names that file. Every entry point runs its typed path through it: - look, B3 and 9P, before any parsing, so `~/x:12`, `~/x:12:3` and `~/x:/re/` all work; - name, and a tag's rename; - Save ; - ThemeFile, DumpDir, Restore and ShaderBuild's shader files; - the forwarding launch. Recent rows are not shown with `~` and need nothing. How names are shown is unchanged. Tests: expandHome's cases, and HOME unset (passwd), with HOME passed in rather than set, since setenv moves the environ a spawned child reads. fs.py covers Save into missing directories under `~`, `name ~/x`, a look at `~/x:3`, and a forwarded `pardes '~/x'`. Co-Authored-By: Claude Opus 5.5 --- docs/fs.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/fs.md b/docs/fs.md index b37511dd..146ff17b 100644 --- a/docs/fs.md +++ b/docs/fs.md @@ -199,7 +199,11 @@ A line written to `look` is a right click on it: selects line 12, newline included; `file:12:5` puts the caret at line 12, byte column 5; `file:` takes any address (below), **evaluated from the file's dot**: `file:/re/` finds the next match after the selection, - `file:0/re/` the first. `:addr` addresses the pane itself. + `file:0/re/` the first. `:addr` addresses the pane itself. A leading `~` + is the home directory ($HOME, else the passwd entry's; `~user` that + user's) here and wherever a path is typed (`name`, `Save`, `ThemeFile`, + `DumpDir`, `Restore`, `pardes '~/x'`), even beside a file named `~`: write + `./~` for that. - `@p:` addresses a pane by serial, a terminal's logical lines too. - a directory types `ls` into a terminal idle there, else opens one there. -- cgit v1.3