Skip to content

Support blocks feature for trzsz-ssh ( tssh ) in search mode #3960

Closed
@lonnywong

Description

@lonnywong

Discord username (optional)

No response

Describe the solution you'd like?

In the shell function is_interactive_ssh_session,
change [[ ${#ARGS[@]} -ne 1 ]] to [[ ${#ARGS[@]} -ne 1 ]] && [[ $(command ssh -V 2>&1) != "trzsz ssh"* ]]:

is_interactive_ssh_session () {
	ARGS=()
	# ...
	if [[ ${#ARGS[@]} -ne 1 ]] && [[ $(command ssh -V 2>&1) != "trzsz ssh"* ]]
	then
		return 1
	fi
}

In the shell function warp_ssh_helper, using -oRemoteCommand instead.
change command ssh -o ControlMaster=yes -o ControlPath=$SSH_SOCKET_DIR/$WARP_SESSION_ID -t "${@:1}" "..." to:

warp_ssh_helper () {
command ssh -o ControlMaster=yes -o ControlPath=$SSH_SOCKET_DIR/$WARP_SESSION_ID -t -oRemoteCommand="
export TERM_PROGRAM='WarpTerminal'
# ...
" "${@:1}"
}

Is your feature request related to a problem? Please describe.

trzsz-ssh ( tssh ) supports the Warp blocks feature if ssh login directly. But it's not working in tssh search mode.

Steps to reproduce:

brew install trzsz-ssh
sudo ln -sv $(which tssh) /usr/local/bin/ssh

# It works if ssh login directly
ssh server

#  It's not working in search mode. tssh will enter search mode without any argument.
ssh

# It works with an argument. e.g., there's a server alias in `~/.ssh/config` contains `s`:
ssh s

Additional context

How important is this feature to you?

3

Warp Internal (ignore) - linear-label:770f6576-d6c0-4e4f-a259-fc64b5156087

None

Activity

dannyneira

dannyneira commented on Dec 13, 2023

@dannyneira
Member

Hi @lonnywong Thanks for submitting such a details feature request!

To anyone else interested in this feature, please add a :+1: to the original post at the top to signal that you want this feature, and subscribe if you'd like to be notified.

drag0n-app

drag0n-app commented on Jan 19, 2024

@drag0n-app

+1

zlsq

zlsq commented on Jan 24, 2024

@zlsq

+1

paststrange

paststrange commented on Mar 10, 2024

@paststrange

+1

00arthur00

00arthur00 commented on Mar 21, 2024

@00arthur00

+1

fisherwei

fisherwei commented on Mar 24, 2024

@fisherwei

+1

SunDaydream

SunDaydream commented on Apr 17, 2024

@SunDaydream

+1

gaoxiang0421

gaoxiang0421 commented on Apr 18, 2024

@gaoxiang0421

+1

mozhu811

mozhu811 commented on May 13, 2024

@mozhu811

+1

fmyhappy

fmyhappy commented on May 16, 2024

@fmyhappy

+1

feixz

feixz commented on Jul 8, 2024

@feixz

+1

lonnywong

lonnywong commented on Jul 13, 2024

@lonnywong
Author

I figured out another way to support blocks feature in trzsz-ssh ( tssh ) search mode.

  1. Install as follows ( ssh -V should show trzsz ssh 0.1.22 ):

    brew update
    brew install trzsz-ssh
    sudo rm /usr/local/bin/ssh
    sudo ln -sv ~/go/bin/tssh /usr/local/bin/ssh
  2. Add the following shell function definition in your .bash_profile ( bash ) or .zshrc ( zsh ):

    tssh() {
        if [ $# -eq 0 ]; then
            ssh FAKE_DEST_IN_WARP
        else
            ssh "$@"
        fi
    }
  3. Restart Warp and run tssh (without arguments). You will be able to search servers to log in to, and the Warp blocks feature should be supported.

中文请参考:trzsz/trzsz-ssh#99 (comment)

XIEJIAHAN

XIEJIAHAN commented on Apr 3, 2025

@XIEJIAHAN

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @fisherwei@drag0n-app@feixz@dannyneira@zlsq

        Issue actions

          Support blocks feature for trzsz-ssh ( tssh ) in search mode · Issue #3960 · warpdotdev/Warp