Skip to main content

Module remote

Module remote 

Source
Expand description

Hangar’s file operations on an SSH connection (spec §6.3 of SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md): the same requests and results as a local folder, carried out by the host’s helper (remote::files). Paths there are the host’s POSIX paths; ~ is its home.

The same rules as a WSL distro’s folders hold (wsl_fs): a host’s system folders, its root and the home folder itself are never changed, only read. There is no Trash on a remote host: deleting there is permanent, and the UI says so before it does.

Structs§

Remote
Where a request runs: an SSH connection’s name and the pane asking (whose window shows any ssh prompt).

Constants§

EDITOR_MAX
The editor’s largest file, as for a local one.
SYSTEM_DIRS 🔒
Folders on a host that are read, never changed (Linux and macOS).

Functions§

create
fs.create on a host; the new path.
delete
fs.delete on a host: PERMANENT, each path on its own. A link is removed, never followed (the helper’s rule).
editor_may_write
Whether the editor may write path on a host: as on this computer, only inside the user’s home there, and never in a system folder.
entry 🔒
friendly 🔒
home_of 🔒
The host’s home as a tidy absolute path: the helper sends it as $HOME says (a trailing /, or / when unset), and every comparison with it must see one spelling.
join 🔒
list
fs.list on a host: the whole folder in one page (the helper pages it underneath), in its canonical form.
list_error 🔒
no_trash
What fs.trash (and fs.restore) say for a remote path: there is no Trash there.
open 🔒
parent 🔒
protected
Whether changing path (absolute, resolved) is refused: the root, a system folder or anything in one, or the home folder itself. Anything inside home is the user’s, even where home is under a system folder (/var/home/<user> on Fedora Silverblue, a home under /opt).
read_file
The editor reading a file on a host: its bytes (at most EDITOR_MAX), and whether nobody may write it.
refusal 🔒
rename
fs.rename on a host; the new path.
resolve
path on the host, absolute and tidy: ~ and a relative path under home, . and empty parts dropped, .. taken back a level (never above /), no trailing /.
ssh_connection
The SSH connection a request names, if it names one: local and WSL requests (and none at all) go the usual way.
valid_name 🔒
write_file
The editor saving a file on a host, atomically there.