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

Cannot execute command-line and remote command #1171

Open
1 task done
YunshuaiPeng opened this issue Apr 23, 2022 · 8 comments
Open
1 task done

Cannot execute command-line and remote command #1171

YunshuaiPeng opened this issue Apr 23, 2022 · 8 comments
Labels
Bugs Bugs, Hangs, Crash, and Freezes

Comments

@YunshuaiPeng
Copy link

YunshuaiPeng commented Apr 23, 2022

Discord username (optional)

No response

Local Shell and Version

5.8

Remote Shell and Version

4.2.46(2)-release

Operating System and Version

macos Monterey v12.3.1 and CentOS Linux 7 (Core)

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

  • Yes

Screenshots

This is my ssh config.

Host xxx
   Hostname xx.xx.xx.xx
   Port xx
   Userxx
   RequestTTY yes
   RemoteCommand cd /xx
   ServerAliveInterval  10
   ServerAliveCountMax  5
   ProxyCommand nc -v -x 127.0.0.1:10086 %h %p

image

If I delete the line RemoteCommand cd /xx, warp will works.


The Warp SSH Wrapper is enabled.

image

Include shell xtrace output

Cannot execute command-line and remote command.

@elviskahoro
Copy link
Contributor

From @CamJN via #502 (reply in thread)

Warp needs to add the ability to run when you have your own remote command set, until they figure that out a cludge would be for them to add -o RemoteCommand=none to their ssh commands, which would disable your command but let their stuff work.

@warpdotdev-devx warpdotdev-devx bot added the Bugs Bugs, Hangs, Crash, and Freezes label Jan 9, 2023
@dannyneira dannyneira mentioned this issue May 22, 2024
2 tasks
@dannyneira
Copy link
Member

Hey Folks, as a workaround you can add command ssh to your Settings > Subshells > Added commands menu, then run command ssh <user@server> to connect to remote session, this will attempt to enable Warp features as a subshell.

You can also try disabling the SSH Wrapper by navigating to Settings > Features. Blocks will stop working but with it disabling, SSH should work as normal.

Related docs:
https://docs.warp.dev/features/ssh
https://docs.warp.dev/features/subshells

If those don't work, please let us know.

@tukusejssirs
Copy link

Adding ssh nor ssh $ssh_host_name to the blocklisted commands does not make it work.

However, running the command in a subshell works:

# Any of these work
"$SHELL" -c 'ssh $ssh_host_name'
bash -c 'ssh $ssh_host_name'
sh -c 'ssh $ssh_host_name'

@nick-youngblut
Copy link

Hey Folks, as a workaround you can add command ssh to your Settings > Subshells > Added commands menu, then run command ssh user@server to connect to remote session, this will attempt to enable Warp features as a subshell.

@dannyneira

Since you have to hard-code <user@server>, this would only really work if you connect to one particular server, correct?

@dannyneira
Copy link
Member

@nick-youngblut if you just add command ssh to the subshell menu, you should be able to use any user@server and still see the "Warpify" subshell option.

@tukusejssirs
Copy link

For me, even if I add command ssh (the actual command with command prefix) to the SettingsSubshellsAdded commands, I still get Cannot execute command-line and remote command.

Moreover, I think the following issues are duplicates of this one:

@nick-youngblut
Copy link

nick-youngblut commented Aug 17, 2024

@dannyneira command ssh does not work for me. I do not get the subshell features (e.g., auto-complete suggestions).

Running ssh to connect to the head node does work. I'm using:

Host my_slurm_cluster_login_node
  HostName X.XX.XX.XX
  User nickyoungblut
  IdentityFile ~/.ssh/id_rsa

...but logging in to either the head node or any other node via command ssh does not provide the subshell features. An example setup for logging into a non-head node:

Host my_slurm_cluster_node
  HostName X.XX.XX.XX
  User nickyoungblut
  IdentityFile ~/.ssh/id_rsa
  RequestTTY yes
  RemoteCommand sh_dev --mem 8G --cpus-per-task 8    # `sh_dev` is just a bash script wrapper around `srun`

To be clear, I can ssh onto any node with command ssh, but I don't get the Starting Shell... message, and none of the many features of Warp (e.g., blocks or auto-complete suggestions).

@bsdave
Copy link

bsdave commented Nov 15, 2024

For me it works: -o RemoteCommand=none

with config

User deploy

# Prod
Host pam
  HostName am-prod-01.lan
  RequestTTY force
  RemoteCommand cd /var/www/project/current; bash -l;

Before:

ssh pam 'cat config/database.yml'
Cannot execute command-line and remote command.

After:

ssh -o RemoteCommand=none pam 'cat config/database.yml'
---
# Managed by infra

production:
  bla bla

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugs Bugs, Hangs, Crash, and Freezes
Projects
None yet
Development

No branches or pull requests

7 participants
@nick-youngblut @tukusejssirs @dannyneira @bsdave @elviskahoro @YunshuaiPeng and others