contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.32k stars 101 forks source link

Improve user feedback for SSH profiles. #1447

Closed ferdinandyb closed 2 months ago

ferdinandyb commented 5 months ago

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

Yaraslaut commented 5 months ago

Conencted to https://github.com/contour-terminal/contour/issues/1326 and https://github.com/contour-terminal/contour/issues/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