## Changes
- **`ssh.pre_connect`**: a local shell command (`sh -c`) runs before every connection (ssh, sftp, scp, tunnel), e.g. to check a VPN.
- Layering works like `proxy_jump`: global → instance or static host → rules. `none` disables an inherited hook.
- The hook gets `NETSSH_HOST`, `NETSSH_TARGET`, `NETSSH_INSTANCE`, `NETSSH_IP`, `NETSSH_KIND`, `NETSSH_TAGS` and `NETSSH_CLIENT`.
- Its output goes to stderr. A non-zero exit aborts the connection. `--dry-run` only prints the hook.
- **`shortcuts.show`**: shows shortcut aliases in three places:
- the TUI host list (`→ alias`)
- an `ALIAS` column in `netssh cache list` and `netssh hosts list`; `--aliases` shows it for a single call
- Tab completion
- Both settings can be edited in `netssh configure` and set through env vars (`NETSSH_SSH_PRE_CONNECT`, `NETSSH_SHORTCUTS_SHOW`).
- README and CHANGELOG (v0.0.29) are updated.
## Tests
- `gofmt`, `go vet` and `go test -count=1 ./...` pass.
- Tested end-to-end with an isolated config:
- the hook runs, and a failing hook ends with exit 1
- `none` set by a rule takes effect
- with `--dry-run` the hook is not run
- lists, completion and the TUI (rendered in tmux) work
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017GpWAuVpPncumMViLLc8N4
- ssh.pre_connect: local shell command run before every connection,
layered like proxy_jump (global, instance/static host, rules; "none"
disables). Host details are passed as NETSSH_* env vars, a non-zero
exit aborts the connection, --dry-run only prints it.
- shortcuts.show: show shortcut aliases in the TUI host list, an ALIAS
column in `cache list` / `hosts list` (also via --aliases) and in Tab
completion.
- Both editable in `netssh configure`; README and CHANGELOG updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAuVpPncumMViLLc8N4
Sebi
merged commit 835b6b48cd into main2026-11-17 11:11:35 +00:00
Sebi
deleted branch feat/pre-connect-hook-alias-display2026-11-17 11:11:37 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Changes
ssh.pre_connect: a local shell command (sh -c) runs before every connection (ssh, sftp, scp, tunnel), e.g. to check a VPN.proxy_jump: global → instance or static host → rules.nonedisables an inherited hook.NETSSH_HOST,NETSSH_TARGET,NETSSH_INSTANCE,NETSSH_IP,NETSSH_KIND,NETSSH_TAGSandNETSSH_CLIENT.--dry-runonly prints the hook.shortcuts.show: shows shortcut aliases in three places:→ alias)ALIAScolumn innetssh cache listandnetssh hosts list;--aliasesshows it for a single callnetssh configureand set through env vars (NETSSH_SSH_PRE_CONNECT,NETSSH_SHORTCUTS_SHOW).Tests
gofmt,go vetandgo test -count=1 ./...pass.noneset by a rule takes effect--dry-runthe hook is not run🤖 Generated with Claude Code
https://claude.ai/code/session_017GpWAuVpPncumMViLLc8N4