You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use motd for all output in coder ssh [--stdio] commands #4927
This is not ideal since we must not get in the way of using SSH normally. Things like:
out=$(ssh coder.workspace ls)
err=$(ssh coder.workspace ls 2>&11>/dev/null)
should work without dirtying the output.
The ideal way to do this would be to utilize motd for all SSH messaging. This would, however, mean that messages are delayed until connection is established. Which would be problematic if we want to inform the users that the cli version is mismatched and we can't establish a connection because of it.
Ultimately we may want to have both methods, reserving the non-motd output for critical messages.
At minimum, we should comb over how we are printing these messages and ensure they’re hidden in non-tty cases.
Edit: This issue was originally created with the incorrect assumption that banner translates to motd, banner is in fact the message shown before authentication, motd is shown just before the login shell.
I think printing to stderr is a good first step, but in the future I think it would be a good idea to start using BannerCallback instead.
At least on systems with /etc/motd and OpenSSH, messages don't appear in non-interactive modes like ssh host ls. I believe this should (automatically) be the case when using BannerCallback too.
But to do that, we'd also need to fix all other occurrences of printing to stdout in the coder ssh [--stdio] command.
The best way to support this would be via VSCode extension. I think it should be fairly easy to detect that this is a Remote SSH connection to a Coder workspace (one option is to check env CODER=true), check workspace status and surface a notification. It could be part of #3597.
We could potentially add a new env to workspaces as well, CODER_WORKSPACE_OUTDATED=true. I can think of a few cool uses but mostly it's "yet another way to detect a workspace is outdated" (YAWTDAWIO?).
changed the title [-]Use motd (`BannerCallback`) for all output in `coder ssh [--stdio]` commands [/-][+]Use motd for all output in `coder ssh [--stdio]` commands [/+]on Nov 16, 2022
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
the ssh nag is presenting a problem for someone. they have a local command aliased to ssh into their workspace and run the same command. when he uses tab to autocomplete the parameters the result is:
$ ffs ls /👋 Your workspace is outdated! Update it here: …
should that message be printing if its a non-interactive session? could there be flags in coder ssh to disable it to prevent
A customer is running into this issue, a non-interactive session should not dirty the output.
Activity
bpmct commentedon Nov 7, 2022
Is
/etc/motdused in terminals on VS Code Remote SSH? A large amount our users connect exclusively through this.mafredri commentedon Nov 8, 2022
@bpmct As @mtojek found out, this does not seem to be the case.
The best way to support this would be via VSCode extension. I think it should be fairly easy to detect that this is a Remote SSH connection to a Coder workspace (one option is to check env
CODER=true), check workspace status and surface a notification. It could be part of #3597.We could potentially add a new env to workspaces as well,
CODER_WORKSPACE_OUTDATED=true. I can think of a few cool uses but mostly it's "yet another way to detect a workspace is outdated" (YAWTDAWIO?).[-]Use motd (`BannerCallback`) for all output in `coder ssh [--stdio]` commands [/-][+]Use motd for all output in `coder ssh [--stdio]` commands [/+]github-actions commentedon Jan 16, 2023
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
github-actions commentedon Apr 24, 2023
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
mafredri commentedon Dec 16, 2023
A customer is running into this issue, a non-interactive session should not dirty the output.
sreya commentedon Apr 4, 2024
Feel free to reopen if this is still a priority