warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.54k stars 378 forks source link

SSH fails for specific host #2764

Open wuhhh opened 1 year ago

wuhhh commented 1 year ago

Discord username (optional)

wuh#5913

Describe the bug

I have a bunch of SSH hosts set up in my ~/.ssh/config file and till now everything's worked fine using Warp to SSH in to each one. Hit a snag today on a WPEngine host though, here is the output:

bash: -c: line 0: syntax error near unexpected token `then'
bash: -c: line 0: `export TERM_PROGRAM=WarpTerminal _user=$(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER) _hostname=$(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n) hook=$(printf {"hook": "SSH", "value": {"socket_path": "~/.ssh/167861612428743", "user": "%s", "host": "%s", "remote_shell": "%s"}} $_user $_hostname ${SHELL##*/} | command od -An -v -tx1 | command tr -d  \n) printf %                                         

Filing this as a Warp bug because I tried in iTerm2 and it works just fine.

To Reproduce

NA

Expected behaviour

NA

Screenshots

https://app.warp.dev/block/h9m1pXZDgQgonjjworqgfZ

Operating System

MacOS

OS Version

12.5.1

Shell Version

zsh 5.8.1 (x86_64-apple-darwin21.0)

Warp Version

0.2023.03.07.08.02.stable_01

Additional context

No response

Does this block you from using Warp daily?

No

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

dannyneira commented 1 year ago

Thanks for letting us know @wuhhh. I'll bring this up with the team and we'll post any updates on this thread.

Please :+1: and comment if you're also seeing this issue as it helps us gauge impact.

ohararyan commented 1 year ago

Can confirm I'm having the same issues as above and getting the same errors when trying to call any ssh command. Falling back to iTerm and SSH works as expected.

For now I've disabled the SSH wrapper as per comment on issue here https://github.com/warpdotdev/Warp/issues/2836#issuecomment-1487243462

ammmze commented 1 year ago

I think it would be great if we could disable the wrapper for certain hosts. I've got an older network switch (ICX6450) and the wrapper has never worked with that device from what I recall. I just get:

$ ssh admin@iceblock
Received disconnect from 10.10.20.2 port 22:2: Bad string Length

But for now I just do this to disable the wrapper for this one session:

WARP_USE_SSH_WRAPPER=0 && ssh admin@iceblock

But I rarely access this device, so I end up having to re-learn the env var every time I do need to get in there.

graham73may commented 1 year ago

Having the sam issue with WPEngine hosting. Having to rely on another terminal app to interact with it.

zachbai commented 1 year ago

@ammmze as an alternative workaround, you can prefix your ssh command with command e.g. command ssh <user@host> to circumvent the SSH wrapper

dingo-d commented 1 year ago

Still happens, and only on WP Engine, works fine for Kinsta. Will there be some official solution for this?

mcDialogs commented 10 months ago

Same here, still happening for WP Engine...

matthewfarlymn commented 9 months ago

@zachbai's solution worked for me with WP Engine.

KrimoPixelsmith commented 8 months ago

Same here specifically for WPEngine

mblais commented 2 months ago

(Copied here from other closed thread)

I just encountered this problem when using ssh to remotely execute a bash script on a wpengine site.

From testing the issue, it appears that wpengine is changing all whitespace characters in the ssh command string into spaces.

As a result wpengine bash is interpreting multi-line bash scripts as a single line, resulting in bash syntax errors.

andybz commented 1 month ago

@ammmze as an alternative workaround, you can prefix your ssh command with command e.g. command ssh <user@host> to circumvent the SSH wrapper

Lifesaver, thank you!