Skip to content

Commit

Permalink
another way to support blocks feature in Warp
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnywong committed Jul 13, 2024
1 parent fd05ceb commit 2af1ecf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
12 changes: 11 additions & 1 deletion README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,17 @@ trzsz-ssh ( tssh ) 设计为 ssh 客户端的直接替代品,提供与 openssh

- 软链后,`ssh -V` 应输出 `trzsz ssh` 加版本号,如果不是,说明软链不成功,或者在 `PATH``openssh` 的优先级更高,你要软链到另一个地方或者调整 `PATH` 的优先级。

- 软链后,要直接使用 `ssh`,它等价于 `tssh`。如果还是用 `tssh` 是不会支持分块 Blocks 功能的。
- 为了让 `tssh` 搜索登录也支持分块 Blocks 功能,需要在 `~/.bash_profile` ( bash ) 或 `~/.zshrc` ( zsh ) 中建一个 `tssh` 函数:

```sh
tssh() {
if [ $# -eq 0 ]; then
ssh FAKE_DEST_IN_WARP
else
ssh "$@"
fi
}
```

- `--dragfile` 参数可能会让 Warp 分块功能失效,请参考前文配置 `EnableDragFile` 来启用拖拽功能。

Expand Down
14 changes: 12 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -690,15 +690,25 @@ trzsz-ssh ( tssh ) is an ssh client designed as a drop-in replacement for the op
## Trouble shooting
- In the Warp terminal, the features like Blocks requires renaming `tssh` to `ssh`. It is recommended to create a soft link (friendly for updates):
- In the Warp terminal, the features like blocks requires renaming `tssh` to `ssh`. It is recommended to create a soft link (friendly for updates):
```
sudo ln -sv $(which tssh) /usr/local/bin/ssh
```
- After the soft link, `ssh -V` should output `trzsz ssh` plus the version number. If not, it means that the soft link is unsuccessful, or `openssh` has a higher priority in `PATH`, and you need to soft link to another path or adjust the priority of `PATH`.
- After the soft link, you need to use `ssh` directly, which is equivalent to `tssh`. If you still use `tssh`, it will not support the Blocks feature.
- In order to make `tssh` search login also support the blocks feature, you need to create a `tssh` function in `~/.bash_profile` ( bash ) or `~/.zshrc` ( zsh ):
```sh
tssh() {
if [ $# -eq 0 ]; then
ssh FAKE_DEST_IN_WARP
else
ssh "$@"
fi
}
```
- The `--dragfile` argument may disable the Warp features, please refer to the previous section to configure `EnableDragFile` to enable the drag and drop to upload feature.
Expand Down
2 changes: 1 addition & 1 deletion tssh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func TsshMain(argv []string) int {
// choose ssh alias
dest := ""
quit := false
if args.Destination == "" {
if args.Destination == "" || args.Destination == "FAKE_DEST_IN_WARP" {
if !isTerminal {
parser.WriteHelp(os.Stderr)
return 3
Expand Down

0 comments on commit 2af1ecf

Please sign in to comment.