Skip to content

Commit

Permalink
ssh_config "=" means no comment at the end of the line #92
Browse files Browse the repository at this point in the history
Co-authored-by: warjiang <[email protected]>
  • Loading branch information
lonnywong and warjiang committed Mar 16, 2024
1 parent ad06400 commit a6c64a6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
15 changes: 15 additions & 0 deletions README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,21 @@ trzsz-ssh ( tssh ) 设计为 ssh 客户端的直接替代品,提供与 openssh
SetTerminalTitle = Yes
```

## 配置注释

- `tssh` 配置中的注释基本与 `openssh` 一致,额外做了一些扩展支持,详见下表:

| 注释 | openssh | tssh |
| :-------------------- | :-----: | :----: |
| `#` 开头的配置行 | 是注释 | 是注释 |
| `#!!` 开头的配置行 | 是注释 | 非注释 |
| `Key Value # Comment` | 看情况 | 是注释 |
| `Key=Value # Comment` | 看情况 | 非注释 |

- `#` 开头的配置行,`openssh` 一律认为是注释;`tssh` 认为 `#!!` 开头的配置行不是注释,其他以 `#` 开头的配置行是注释。
- `Key Value # Comment` 配置(没有 `=` 号),`openssh` 有些情况认为 `#` 后的内容是注释,有些情况认为不是注释;`tssh` 一律认为 `#` 后的内容是注释。
- `Key=Value # Comment` 配置(有 `=` 号),`openssh` 有些情况认为 `#` 后的内容是注释,有些情况认为不是注释;`tssh` 一律认为 `#` 后的内容不是注释。

## 其他功能

- 使用 `-f` 后台运行时,可以加上 `--reconnect` 参数,在后台进程因连接断开等而退出时,会自动重新连接。
Expand Down
17 changes: 17 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,23 @@ trzsz-ssh ( tssh ) is an ssh client designed as a drop-in replacement for the op
SetTerminalTitle = Yes
```
## Comments of Config
- The comments in the `tssh` configuration are basically the same as `openssh`, with some additional extended support, see the following table for details:
| Comments | openssh | tssh |
| :-------------------- | :----------: | :-----------: |
| Starting with `#` | Is a comment | Is a comment |
| Starting with `#!!` | Is a comment | Not a comment |
| `Key Value # Comment` | It depends | Is a comment |
| `Key=Value # Comment` | It depends | Not a comment |
- Configuration starting with `#` are always considered by `openssh` to be a comment; `tssh` considers configuration starting with `#!!` not to be a comment, and other configurations starting with `#` are comments.
- `Key Value # Comment` configuration (without `=` sign), `openssh` considers the content after `#` to be a comment in some cases, and considers it not to be a comment in some other cases; `tssh` always considers the content after `#` to be a comment.
- `Key=Value # Comment` configuration (with `=` sign), `openssh` considers the content after `#` to be a comment in some cases, and considers it not to be a comment in some other cases; `tssh` always considers the content after `#` not to be a comment.
## Other Features
- Use `-f` to run in the background, you can add `--reconnect`, it will automatically reconnect when the background process exits.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ trzsz-ssh ( tssh ) offers additional useful features:
| [Automated Interaction](README.en.md#automated-interaction) | [自动交互](README.cn.md#%E8%87%AA%E5%8A%A8%E4%BA%A4%E4%BA%92) |
| [Remember Password](README.en.md#remember-password) | [记住密码](README.cn.md#%E8%AE%B0%E4%BD%8F%E5%AF%86%E7%A0%81) |
| [Custom Configuration](README.en.md#custom-configuration) | [个性配置](README.cn.md#%E4%B8%AA%E6%80%A7%E9%85%8D%E7%BD%AE) |
| [Comments of Config](README.en.md#comments-of-config) | [配置注释](README.cn.md#%E9%85%8D%E7%BD%AE%E6%B3%A8%E9%87%8A) |
| [Other Features](README.en.md#other-features) | [其他功能](README.cn.md#%E5%85%B6%E4%BB%96%E5%8A%9F%E8%83%BD) |

## Installation
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/trzsz/go-arg v1.5.3
github.com/trzsz/iterm2 v0.1.2
github.com/trzsz/promptui v0.10.7
github.com/trzsz/ssh_config v1.3.4
github.com/trzsz/ssh_config v1.3.5
github.com/trzsz/trzsz-go v1.1.8-0.20240303135018-b95b67671472
golang.org/x/crypto v0.20.0
golang.org/x/sys v0.17.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ github.com/trzsz/iterm2 v0.1.2 h1:VwfLzr2fKeaLf+p4tS0ms+kqdiQQxVLbTJUoyuQXmK8=
github.com/trzsz/iterm2 v0.1.2/go.mod h1:PMI+3JcT7J9D0T6e3mOWv8ICYdrrNZwuge3Tm7zDLws=
github.com/trzsz/promptui v0.10.7 h1:77uBrmsIPYYJS/9n+zwFRhwOz82EKXkkdjOiWSEUPpk=
github.com/trzsz/promptui v0.10.7/go.mod h1:9dp59ixe32qBV9GjDxQ1PDWwbzHjTzveZenQwEoVHbg=
github.com/trzsz/ssh_config v1.3.4 h1:7of+6rUmdWdqfgXnH9csgJe1kNkriS9xOiFGx4KCkEw=
github.com/trzsz/ssh_config v1.3.4/go.mod h1:Dl1okTjVVfsrtTA8nqkJ1OnjiCrZY6DUEI2DGT2/YoQ=
github.com/trzsz/ssh_config v1.3.5 h1:wSZT2PG/7IICvHTIGeDQF5xT5HMXwRfYdnC8IcM3Yk8=
github.com/trzsz/ssh_config v1.3.5/go.mod h1:Dl1okTjVVfsrtTA8nqkJ1OnjiCrZY6DUEI2DGT2/YoQ=
github.com/trzsz/trzsz-go v1.1.8-0.20240303135018-b95b67671472 h1:ZtVHV/7EQCJmqUS2ZDPfYVn0IUVF7nXj6d6rF7v90dc=
github.com/trzsz/trzsz-go v1.1.8-0.20240303135018-b95b67671472/go.mod h1:WLMZCtkmAKnH66bHRhB2iFbY/e+wBPDGkeOJuP60qxY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
Expand Down

0 comments on commit a6c64a6

Please sign in to comment.