contour-terminal/contour

Improve user feedback for SSH profiles.

ferdinandyb opened this issue ยท 1 comments

Abstract

If you start contour with an ssh profile, and the server is unreachable contour only gives some feedback on STDOUT and exists, the application itself is not started. If you launch contour without being attached to a terminal, you only see that nothing is happening. It would be better if contour started up and printed the error message. It might even be better, if in case the ssh profile is NOT the default profile, that contour would instead try to load the default profile. Also, a setting would be nice that would limit the amount of output on a successful connection.

Motivation

The current STDOUT feedback is on an unsuccessful connection is:

[2024-02-01 12:05:03.1052916.105291] [ssh] Starting SSH session to host: bferdinandy@192.168.17.227:2222
[2024-02-01 12:05:03.1056046.105604] [ssh] () State transition from Initial to Started.
[2024-02-01 12:05:03.1057534.105753] [ssh] () State transition from Started to Connect.
[error] Failed to connect to 192.168.17.227:2222 (No such file or directory)

You don't see this when starting from the GUI, say an i3 shortcut or a windows shortcut.

A successful connection on the other hand has a lot of mostly unnecessary information:

๐Ÿ”‘  Starting SSH session to host: bferdinandy@192.168.17.227:2222
๐Ÿ”‘  Connected to 192.168.17.227:2222
๐Ÿ”‘  Host key verification succeeded ([redact]).
๐Ÿ”‘  Could not authenticate with SSH agent with identity: cardno:[redact]
๐Ÿ”‘  Failed to authenticate with SSH agent. No more identities available.

๐Ÿ”‘  Successfully authenticated with private key.
๐Ÿ”‘  Failed to set SSH environment variable "COLORTERM". Request denied
๐Ÿ”‘  Failed to set SSH environment variable "TERMINAL_NAME". Request denied
๐Ÿ”‘  Failed to set SSH environment variable "TERMINAL_VERSION_STRING". Request denied
๐Ÿ”‘  Failed to set SSH environment variable "TERMINAL_VERSION_TRIPLE". Request denied

Specification

  • When SSH profile is started, the application window should be opened at the latest when the "Starting SSH session to host: bferdinandy@192.168.17.227:2222" is printed. Note that on a successful connection, this is the first line that is shown in the terminal, so it's sort of already there.
  • If the connection is unsuccessful, the "Failed to connect to 192.168.17.227:2222 (No such file or directory)" should be printed in red (side note: why is this a no file/dir error?).
  • Optionally, if the connection is unsuccessful, and the SSH profile is not the default profile, the default profile should be loaded instead.

Conencted to #1326 and #1327

Also, some of the ssh logs must be moved into debug flags, with only two left as info for the user:

๐Ÿ”‘  Starting SSH session to host: bferdinandy@192.168.17.227:2222
๐Ÿ”‘  Connected to 192.168.17.227:2222