Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH - Support Fish for remote machines #871

Open
elviskahoro opened this issue Apr 1, 2022 · 29 comments
Open

SSH - Support Fish for remote machines #871

elviskahoro opened this issue Apr 1, 2022 · 29 comments
Labels
Feature requests Feature Requests
Milestone

Comments

@elviskahoro
Copy link
Member

Describe the solution you'd like?

Public facing GitHub issue for supporting Fish over SSH!

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

No response

Additional context

No response

@elviskahoro
Copy link
Member Author

From @Toma62299781 via #1054

Discord username (optional)

No response

Shell and Version

fish shell 3.3.1

Operating System and Version

macOS Monterey 12.3.1

I have tried commenting out my system & user rcfiles and warp still will not bootstrap

  • Yes

Screenshots

Warp raised an error when I tried to use SSH, the screenshot is shown below. Thanks for your great software.

image

The command I used in the screenshot is like `ssh username@ip -oPort=xxxx`. By the way, the same command works fine under zsh.

Include shell xtrace output

No response

@elviskahoro
Copy link
Member Author

From @victortrac via #1054
Man.. I spent hours trying to figure out WTF was wrong with my fish.config on my SSH host. I couldn't find any trace of this code in any of my functions, plugins, etc. Turns out it's an issue with warp. 🤦

@elviskahoro
Copy link
Member Author

From @SichangHe via #1054
Same problem

ssh username@ip
username@ip's password:
fish: Unsupported use of '='. In fish, please use 'set hook $(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/15932\", \"user\": \"%s\", \"machine\": \"%s\", \"remote_shell\": \"%s\"}}" $(whoami) $(hostname) ${SHELL##*/} | command xxd -p | command tr -d "\n")'.
Connection to ip closed.

@ghost
Copy link

ghost commented Aug 15, 2022

I have the same issue as @elviskahoro , would like to be able to use the warp ssh wrapper with fish shell on my remote machines. for now I've fallen back to bash on the remote machines, but I want to use fish.

fish 3.5.1 on macOS Monterrey 12.5

@SerenadeX
Copy link

I am still having this issue as well. macOS Monterey 12.6, fish shell 3.5.1

@sebastiandeutsch
Copy link

sebastiandeutsch commented Nov 24, 2022

The problem still exists. I'm ssh onto a server with fish as default and I'll get this error:

fish: Unsupported use of '='. In fish, please use 'set hook $(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/25958\", \"user\": \"%s\", \"machine\": \"%s\", \"remote_shell\": \"%s\"}}" $(whoami) $(hostname) ${SHELL##*/} | command od -An -v -tx1 | command tr -d " \n")'.

using

ssh -vvvv ...

Will give you slightly more info.

What does this hook do? It actually looks a bit shady.

@cezarmathe
Copy link

Is fish over SSH going to be a thing?

@warpdotdev-devx warpdotdev-devx bot added the Feature requests Feature Requests label Jan 9, 2023
@nihaals
Copy link

nihaals commented Feb 28, 2023

It would be nice if ssh -t host bash worked as a workaround (currently it just does nothing in terms of Warp)

@ajnart
Copy link

ajnart commented Mar 2, 2023

I also want this ! Do you have an ETA ? Currently I am using /usr/bin/ssh to start SSH sessions with my server that uses fish shell.

@mboyd1
Copy link

mboyd1 commented Jun 19, 2023

since Warp seems so keen on collecting user telemetry data here's a free telemetry signal for you, this remote server fish issue completely blocks me from using your product

@dannyneira
Copy link
Member

dannyneira commented Jul 17, 2023

hey folks, Sorry about the delays on this. If it's any consolation you can add the following line to your remote config.fish:

if status is-interactive
  printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "fish"}}\x9c'
end

then use /usr/bin/ssh to ssh into the remote fish machine and Warp features should work.

@okleinschmidt
Copy link

okleinschmidt commented Aug 26, 2023

hey folks, Sorry about the delays on this. If it's any consolation you can add the following line to your remote config.fish:

if status is-interactive
  printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "fish"}}\x9c'
end

then use /usr/bin/ssh to ssh into the remote fish machine and Warp features should work.

Then I get "Starting shell..."

@pan93412
Copy link

For people encountering this issue:

❯  [ -z $WARP_BOOTSTRAPPED ] && eval 'set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;'
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                              ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                           ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                                                                                                                     ^

Just upgrade Fish to 3.6.1 with the following command (if you are using Ubuntu LTS):

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
sudo apt upgrade fish

It works! :D

@okleinschmidt
Copy link

For people encountering this issue:

❯  [ -z $WARP_BOOTSTRAPPED ] && eval 'set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;'
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                              ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                           ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                                                                                                                     ^

Just upgrade Fish to 3.6.1 with the following command (if you are using Ubuntu LTS):

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
sudo apt upgrade fish

It works! :D

Mh. Doesn't work for me. I use fish 3.6.1 on my Mac as well as on my remote machines. Still got that error. :-(

@pan93412
Copy link

For people encountering this issue:

❯  [ -z $WARP_BOOTSTRAPPED ] && eval 'set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;'
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                              ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                           ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                                                                                                                     ^

Just upgrade Fish to 3.6.1 with the following command (if you are using Ubuntu LTS):

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
sudo apt upgrade fish

It works! :D

Mh. Doesn't work for me. I use fish 3.6.1 on my Mac as well as on my remote machines. Still got that error. :-(

How about running fish --version in your remote machine?

@ajnart
Copy link

ajnart commented Sep 29, 2023

For people encountering this issue:

❯  [ -z $WARP_BOOTSTRAPPED ] && eval 'set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;'
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                              ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                           ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                                                                                                                     ^

Just upgrade Fish to 3.6.1 with the following command (if you are using Ubuntu LTS):

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
sudo apt upgrade fish

It works! :D

Mh. Doesn't work for me. I use fish 3.6.1 on my Mac as well as on my remote machines. Still got that error. :-(

How about running fish --version in your remote machine?

Also using v3.6.1 for me on local and remote and still getting an error when using Warp’s wrapper for ssh

@okleinschmidt
Copy link

For people encountering this issue:

❯  [ -z $WARP_BOOTSTRAPPED ] && eval 'set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;'
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                              ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                           ^
fish: Expected a variable name after this $.
set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;
                                                                                                                                                                                                                                     ^

Just upgrade Fish to 3.6.1 with the following command (if you are using Ubuntu LTS):

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update
sudo apt upgrade fish

It works! :D

Mh. Doesn't work for me. I use fish 3.6.1 on my Mac as well as on my remote machines. Still got that error. :-(

How about running fish --version in your remote machine?

~ fish --version
fish, version 3.6.1

@lexpierce
Copy link

lexpierce commented Oct 7, 2023

Still doesn't work. Time to uninstall warp and try again in a few months. I can't have a split workflow. It's cool enough I am willing to check it out every few months, but not use when basic functionality I would use is broken.

Warp v0.2023.10.03.08.03.stable_01

neofetch
                    'c.          lexpierce@laptop
                 ,xNMM.          ------------------------
               .OMMMMo           OS: macOS 14.0 23A344 arm64
               OMMM0,            Host: Mac14,2
     .;loddo:' loolloddol;.      Kernel: 23.0.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 7 days, 3 hours, 20 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 194 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: fish 3.6.1
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1280x832
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Rectangle
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    Terminal: WarpTerminal
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   CPU: Apple M2
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   GPU: Apple M2
    kMMMMMMMMMMMMMMMMMMMMMMd     Memory: 1450MiB / 8192MiB
     ;KMMMMMMMWXXWMMMMMMMk.
       .cooc,.    .,coo:.

and remote system:

> neofetch
             .',;::::;,'.                lexpierce@servername
         .';:cccccccccccc:;,.            -------------------
      .;cccccccccccccccccccccc;.         OS: Fedora Linux 39 (Thirty Nine Prerelease) x86_64
    .:cccccccccccccccccccccccccc:.       Kernel: 6.5.5-300.fc39.x86_64
  .;ccccccccccccc;.:dddl:.;ccccccc;.     Uptime: 4 days, 9 hours, 48 mins
 .:ccccccccccccc;OWMKOOXMWd;ccccccc:.    Packages: 2702 (rpm)
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:.   Shell: fish 3.6.1
,cccccccccccccc;MMM.;cc;;WW::cccccccc,   Resolution: 3440x1440
:cccccccccccccc;MMM.;cccccccccccccccc:   Terminal: /dev/pts/1
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc:   CPU: AMD Ryzen 7 3700X (16) @ 3.600GHz
cccccc:0MMKxdd:;MMMkddc.;cccccccccccc;   GPU: AMD ATI Radeon RX 5600 OEM/5600 XT / 5700/5700 XT
ccccc:XM0';cccc;MMM.;cccccccccccccccc'   Memory: 1092MiB / 31729MiB
ccccc;MMo;ccccc;MMW.;ccccccccccccccc;
ccccc;0MNc.ccc.xMMd:ccccccccccccccc;
cccccc;dNMWXXXWM0::cccccccccccccc:,
cccccccc;.:odl:.;cccccccccccccc:,.
:cccccccccccccccccccccccccccc:'.
.:cccccccccccccccccccccc:;,..
  '::cccccccccccccc::;,.

and error:

ssh servername
fish: Unsupported use of '='. In fish, please use 'set hook $(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/2495\", \"remote_shell\": \"%s\"}}" "${SHELL##*/}" | command od -An -v -tx1 | command tr -d " \n")'.
hook=$(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/2495\", \"remote_shell\": \"%s\"}}" "${SHELL##*/}" | command od -An -v -tx1 | command tr -d " \n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Connection to servername closed.

@pan93412
Copy link

pan93412 commented Oct 7, 2023

Still doesn't work. Time to uninstall warp and try again in a few months. I can't have a split workflow. It's cool enough I am willing to check it out every few months, but not use when basic functionality I would use is broken.

Warp v0.2023.10.03.08.03.stable_01

neofetch
                    'c.          lexpierce@laptop
                 ,xNMM.          ------------------------
               .OMMMMo           OS: macOS 14.0 23A344 arm64
               OMMM0,            Host: Mac14,2
     .;loddo:' loolloddol;.      Kernel: 23.0.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 7 days, 3 hours, 20 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 194 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: fish 3.6.1
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1280x832
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Rectangle
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    Terminal: WarpTerminal
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   CPU: Apple M2
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   GPU: Apple M2
    kMMMMMMMMMMMMMMMMMMMMMMd     Memory: 1450MiB / 8192MiB
     ;KMMMMMMMWXXWMMMMMMMk.
       .cooc,.    .,coo:.

and remote system:

> neofetch
             .',;::::;,'.                lexpierce@servername
         .';:cccccccccccc:;,.            -------------------
      .;cccccccccccccccccccccc;.         OS: Fedora Linux 39 (Thirty Nine Prerelease) x86_64
    .:cccccccccccccccccccccccccc:.       Kernel: 6.5.5-300.fc39.x86_64
  .;ccccccccccccc;.:dddl:.;ccccccc;.     Uptime: 4 days, 9 hours, 48 mins
 .:ccccccccccccc;OWMKOOXMWd;ccccccc:.    Packages: 2702 (rpm)
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:.   Shell: fish 3.6.1
,cccccccccccccc;MMM.;cc;;WW::cccccccc,   Resolution: 3440x1440
:cccccccccccccc;MMM.;cccccccccccccccc:   Terminal: /dev/pts/1
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc:   CPU: AMD Ryzen 7 3700X (16) @ 3.600GHz
cccccc:0MMKxdd:;MMMkddc.;cccccccccccc;   GPU: AMD ATI Radeon RX 5600 OEM/5600 XT / 5700/5700 XT
ccccc:XM0';cccc;MMM.;cccccccccccccccc'   Memory: 1092MiB / 31729MiB
ccccc;MMo;ccccc;MMW.;ccccccccccccccc;
ccccc;0MNc.ccc.xMMd:ccccccccccccccc;
cccccc;dNMWXXXWM0::cccccccccccccc:,
cccccccc;.:odl:.;cccccccccccccc:,.
:cccccccccccccccccccccccccccc:'.
.:cccccccccccccccccccccc:;,..
  '::cccccccccccccc::;,.

and error:

ssh servername
fish: Unsupported use of '='. In fish, please use 'set hook $(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/2495\", \"remote_shell\": \"%s\"}}" "${SHELL##*/}" | command od -An -v -tx1 | command tr -d " \n")'.
hook=$(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/2495\", \"remote_shell\": \"%s\"}}" "${SHELL##*/}" | command od -An -v -tx1 | command tr -d " \n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Connection to servername closed.

You need to disable SSH integration first or using /usr/bin/ssh.

@lexpierce
Copy link

and error:

ssh servername
fish: Unsupported use of '='. In fish, please use 'set hook $(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/2495\", \"remote_shell\": \"%s\"}}" "${SHELL##*/}" | command od -An -v -tx1 | command tr -d " \n")'.
hook=$(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/2495\", \"remote_shell\": \"%s\"}}" "${SHELL##*/}" | command od -An -v -tx1 | command tr -d " \n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Connection to servername closed.

You need to disable SSH integration first or using /usr/bin/ssh.

Almost all of my shell work is on remote systems. Warp is useless without the shell integrations through SSH to me. Might as well keep using iTerm, which I am more familiar with.

@pan93412
Copy link

pan93412 commented Oct 7, 2023

Almost all of my shell work is on remote systems. Warp is useless without the shell integrations through SSH to me. Might as well keep using iTerm, which I am more familiar with.

Well. You misunderstood our solution.

  1. Disabling remote shell integration will only disable the automatic Warpify code injection of SSH. It does not affect the manual Warpify operation.
  2. Then, we write the correct Warpify code in our Fish initialization script, ~/.config/fish/config.fish: SSH - Support Fish for remote machines #871 (comment).
  3. Using the normal SSH way to sign in your machine. Your initialization script will work as what Warp's injection code does, and Warp shell will start warpify your shell.

So don't worry – even disabling the option, it won't affect the integration of Fish if you have written the Warpify code in your config.fish. Just make sure the version of your Fish is at least 3.6.

@lexpierce
Copy link

Ok, so it’s a partial solution for my personal systems. It does make fish seem like a secondary priority which gives me long term worries.

I’ll give it a try and see if it’s truly worth adding to a larger scale template deployment. It looks like it’s safe but must test all changes.

@efc
Copy link

efc commented Nov 18, 2023

I am trying the manual Warpify code for fish and that does get me into the remote with a fish shell, however there are still some rather unfortunate gaps when working with the remote fish shell.

When I use Warp with a local fish shell, fish can cleverly supply autocompletes for anywhere in the filesystem. For example, if I make a new directory with mkdir silly and then type ls s fish will suggest ls silly automatically.

However, when I use Warp with a remote fish shell, fish is not nearly as clever. When I get to the ls s step in the scenario above, fish will not suggest ls silly. Note, if I visit the same remote fish shell using Terminal, then fish happily fills in the brand new directory name for me. Also, once I complete the command for the first time, then fish is able to predict that completion just fine, even in Warp. But the effect is that the first time I visit any new path using Warp and remote fish shells I am "flying blind".

So clearly, even when it "works", Warp is interfering with the fish shell on the remote system in a way that is problematic.

Does anyone have suggestions of what might be going wrong?

@efc
Copy link

efc commented Nov 20, 2023

I just tried the "show background blocks" feature and it shows a radically different behavior when on a local machine vs. a remote machine. When I type ls s on a local terminal in Warp, there are no extra blocks shown. But on the remote host Warp is running this warp_run_generator_command script on every keystroke:

case "${SHELL##*/}" in
zsh) set -o nullglob;;
bash) shopt -s nullglob; GLOBIGNORE=.:..;;
esac

for f in .* *; do
file_type=\'File\'
if [ -d "$f" ]; then
    line="{\"file_name\": \"$f\", \"file_type\": \"Directory\"}"
else
    line="{\"file_name\": \"$f\", \"file_type\": \"File\"}"
fi
printf "$line\n"
done

I suspect this is what is causing Warp to fail to show Fish autocompletes properly.

@ajnart
Copy link

ajnart commented Nov 25, 2023

I just tried the "show background blocks" feature and it shows a radically different behavior when on a local machine vs. a remote machine. When I type ls s on a local terminal in Warp, there are no extra blocks shown. But on the remote host Warp is running this warp_run_generator_command script on every keystroke:

case "${SHELL##*/}" in
zsh) set -o nullglob;;
bash) shopt -s nullglob; GLOBIGNORE=.:..;;
esac

for f in .* *; do
file_type=\'File\'
if [ -d "$f" ]; then
    line="{\"file_name\": \"$f\", \"file_type\": \"Directory\"}"
else
    line="{\"file_name\": \"$f\", \"file_type\": \"File\"}"
fi
printf "$line\n"
done

I suspect this is what is causing Warp to fail to show Fish autocompletes properly.

Interested by this, I asked chatGPT to translate it into a fish-compatible script and it gave me the following

switch (basename $SHELL)
    case 'zsh'
        set -q GLOB_NOMATCH; and set -e GLOB_NOMATCH
    case 'bash'
        set -q GLOB_NOMATCH; and set -e GLOB_NOMATCH
        set GLOBIGNORE . '..'
end

for f in .* *
    set file_type 'File'
    if test -d $f
        set line "{\"file_name\": \"$f\", \"file_type\": \"Directory\"}"
    else
        set line "{\"file_name\": \"$f\", \"file_type\": \"File\"}"
    end
    printf "$line\n"
end

Not sure of how good it is but maybe there is a way to overwrite this function and make it use a fish-compatible one?

@lessless
Copy link

I can't ssh into FreeBSD 14 after switching shell to fish:

debug1: Sending command:
                         export TERM_PROGRAM='WarpTerminal'
                                                           hook=$(printf "{\\"hook\\": \\"SSH\\", \\"value\\": {\\"socket_path\\": \\"~/.ssh/13167\\", \\"remote_shell\\": \\"%s\\"}}" "${SHELL##*/}" | command od -An -v -tx1 | command tr -d " \\n")
                      printf '\033P$d%s�234' $hook
                                                  if test "${SHELL##*/}" != "bash" -a "${SHELL##*/}" != "zsh"; then
    if test ! -e $HOME/.hushlogin; then
                                        if test -r /etc/motd; then
                                                                   cat /etc/motd
                                                                                 elif test -r /run/motd; then
                                                                                                              cat /run/motd
            elif test -r /run/motd.dynamic; then
                                                 cat /run/motd.dynamic
                                                                       elif test -r /usr/lib/motd; then
                                                                                                        cat /usr/lib/motd
          elif test -r /usr/lib/motd.dynamic; then
                                                   cat /usr/lib/motd.dynamic
                                                                             fi
                                                                                fi
                                                                                   if test -r /etc/profile; then
                                                                                                                 . /etc/profile
                fi
                   exec $SHELL
                              fi
                                case ${SHELL##*/} in
                                                    bash)
                                                          exec -a bash bash --rcfile <(echo '
                                                                                              stty raw
                                                                                                       HISTCONTROL=ignorespace
               HISTIGNORE=" *"
                               WARP_SESSION_ID="$(date +%s)$RANDOM"
                                                                    _hostname=$(command -v hostname >/dev/null 2>&1 && command host
debug2: channel 1: request exec confirm 1
debug3: send packet: type 98
debug3: client_repledge: enter
debug2: channel_input_open_confirmation: channel 1: callback done
debug2: channel 1: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 1
debug2: PTY allocation request accepted on channel 1
debug2: channel 1: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 1
debug2: exec request accepted on channel 1
debug3: receive packet: type 96
debug2: channel 1: rcvd eof
debug2: channel 1: output open -> drain
fish: Unsupported use of '='. In fish, please use 'set hook $(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/13167\", \"remote_shell\": \"%s\"}}" "${SHELL##*/}" | command od -An -v -tx1 | command tr -d " \n")'.
hook=$(printf "{\"hook\": \"SSH\", \"value\": {\"socket_path\": \"~/.ssh/13167\", \"remote_shell\": \"%s\"}}" "${SHELL##*/}" | command od -An -v -tx1 | command tr -d " \n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

@bdmorin
Copy link

bdmorin commented Jan 1, 2024

Adding my anti-fish experiences here

https://app.warp.dev/block/5uVCeEoLsOS1XjVWGwN0rZ
https://app.warp.dev/block/PM5Vq7PMbOu0FyfwjJGMrZ

If my default shell is fish on remote host, (fish, version 3.6.4), the whole thing blows up. I changed the default shell to bash, and it worked, but on the remote host if I simply launched bash, it blows up.

I would like to try helping fix this, but I can't figure out where this warp process cuts in, or where the scripts are kept.

@publicqi
Copy link

Are you planning to fix it though?

@shirok1
Copy link

shirok1 commented Apr 21, 2024

The SourcedRcFileForWarp for fish is still literally half-baked. Support for $() is only added after 3.5.0 (released June 16, 2022) and shouldn't be take granted if you ever want to connect to Linux servers running stable distributions...Have you guys at Warp actually tested it?

[ -z $WARP_BOOTSTRAPPED ] && eval 'export WARP_HONOR_PS1=0; export WARP_COMBINED_PROMPT_COMMAND_GRID=0; set -g WARP_SESSION_ID (random);set _hostname $(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user $(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg $(echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;'

It could have work, if the $s are removed!

[ -z $WARP_BOOTSTRAPPED ] && eval 'export WARP_HONOR_PS1=0; export WARP_COMBINED_PROMPT_COMMAND_GRID=0; set -g WARP_SESSION_ID (random);set _hostname (command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n);set _user (command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER);set _msg (echo -n "{\"hook\": \"InitShell\", \"value\": {\"session_id\": $WARP_SESSION_ID, \"user\": \"$_user\", \"hostname\": \"$_hostname\", \"shell\": \"fish\", \"is_subshell\": true}}" | od -An -v -tx1 | command tr -d " \n");echo -n \u1b\u50\u24"d$_msg"\u9c;set -e _hostname _user _msg;'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature requests Feature Requests
Projects
None yet
Development

No branches or pull requests