Environment
Markdown Card Variable Capture
Markdown cards can reference shell variables with ${NAME}. Subspace resolves them by spawning the configured shell as a login but non-interactive shell (<shell> -lc env), parsing its output, and substituting the values into rendered cards.
Because the spawn is non-interactive, .zshrc / .bashrc are not sourced. Any variable you want subspace to see must be exported from a login init file:
| Shell | Put exports in |
|---|---|
| zsh | ~/.zprofile, ~/.zlogin, or ~/.zshenv |
| bash | ~/.bash_profile, ~/.bash_login, ~/.profile |
Interactive shells are deliberately avoided: they take over the controlling terminal (job control, /dev/tty, terminal mode setup), which would leave the terminal hosting subspace serve in a state where ctrl-c no longer reaches the process.
Proxy Variables
Subspace clears all proxy-related environment variables on startup:
HTTP_PROXY/http_proxyHTTPS_PROXY/https_proxyNO_PROXY/no_proxyALL_PROXY/all_proxy
This prevents the proxy itself (and its upstream dialers) from being influenced by system proxy settings. Routing is controlled exclusively by the config file.
XDG Config
Subspace respects $XDG_CONFIG_HOME for locating the default config directory.
| Variable | Default | Used for |
|---|---|---|
$XDG_CONFIG_HOME | ~/.config | Config file and control socket default paths |
Default paths when $XDG_CONFIG_HOME is not set:
- Config:
~/.config/subspace/config.kdl - Control socket:
~/.config/subspace/control.sock
When set:
- Config:
$XDG_CONFIG_HOME/subspace/config.kdl - Control socket:
$XDG_CONFIG_HOME/subspace/control.sock
Color Output
Subspace auto-detects terminal capability for colored output.
| Variable | Effect |
|---|---|
$NO_COLOR | Set to any value to disable all colored output |
Color is also disabled when stderr is not a terminal (e.g. when piping output).
Control Socket
The status and logs commands communicate with a running server via a Unix domain socket. The socket path is determined by the config file's control_socket setting.
The socket serves an HTTP API with the following endpoints:
| Endpoint | Method | Description |
|---|---|---|
/status | GET | JSON status with health checks, stats, and pool info |
/stats | GET | JSON statistics snapshot |
/logs | GET | Streaming log lines with level filtering |
/logs Query Parameters
| Parameter | Default | Description |
|---|---|---|
n | 10 | Number of historical lines |
level | info | Minimum level: debug, info, warn, error |
follow | true | Stream live lines after history (false to stop after history) |
