Documentation
¶
Overview ¶
Package snapenv adapts RemoHop to running from its snap package (packaging/snap). The snap uses classic confinement, so the program sees the system as any other install does; two things still differ, and both are handled here:
- `snap run` adds SNAP, SNAP_NAME, SNAP_REVISION and a dozen other SNAP_* variables to the environment. Every process the host starts inherits that environment (remote shells, xdg-open, screen capture helpers), and programs that see SNAP believe they run inside a snap themselves (GTK and Electron apps switch to portals, scripts change paths). Setup removes them, so a remote shell gets the user's real environment, as with the other packages.
- The program lives in /snap/<name>/<revision>/, a directory that is deleted a few refreshes later. StableExe turns such a path into /snap/<name>/current/..., which snapd points at every new revision, for files that outlive this process (the systemd unit of `remohop service install`).
Outside a snap both are no-ops, and so is everything on systems other than Linux, where snaps do not exist.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
func Setup()
Setup records whether this process runs from a snap and, if so, removes snapd's variables from its environment. Call it once, before anything starts a child process. A SNAP variable that does not name the directory this binary runs from (one leaked from another snap's terminal, say) is left alone.
Types ¶
This section is empty.