Skip to content

fix(cli): show startup feedback for foreground forwards#296

Merged
pimlock merged 3 commits intomainfrom
fix-295-forward-start-feedback
Mar 14, 2026
Merged

fix(cli): show startup feedback for foreground forwards#296
pimlock merged 3 commits intomainfrom
fix-295-forward-start-feedback

Conversation

@pimlock
Copy link
Copy Markdown
Collaborator

@pimlock pimlock commented Mar 14, 2026

Closes #295

Summary

  • print a foreground startup message when openshell forward start stays attached
  • fail early when SSH cannot establish the port forward with ExitOnForwardFailure=yes
  • document the updated foreground forward behavior and add a unit test for the message text
CleanShot 2026-03-13 at 20 12 15@2x

Test Plan

  • cargo test -p openshell-cli foreground_forward_started_message_includes_port_and_stop_hint -j 2
  • uv sync
  • mise run pre-commit

Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
@pimlock pimlock self-assigned this Mar 14, 2026
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Comment on lines +319 to +320
.arg("-o")
.arg("ExitOnForwardFailure=yes")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this, if the tunnel is not established for some reason (e.g. port is already used), it will exit. Currently it will hang after printing this:

openshell forward start 10001 peaceful-stinkbug
bind [::1]:10001: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 10001
Could not request local forwarding.

# hangs

@pimlock pimlock requested review from drew and johntmyers March 14, 2026 03:12
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
@pimlock pimlock merged commit 72868ea into main Mar 14, 2026
9 checks passed
@pimlock pimlock deleted the fix-295-forward-start-feedback branch March 14, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(openshell): print startup confirmation when forwarding begins

2 participants