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

Lando commands fail silently when run from a code-server terminal #3306

Closed
tanc opened this issue May 7, 2021 · 12 comments
Closed

Lando commands fail silently when run from a code-server terminal #3306

tanc opened this issue May 7, 2021 · 12 comments

Comments

@tanc
Copy link

tanc commented May 7, 2021

OS/Web Information

  • Web Browser: Edge, Safari (iOS)
  • Local OS: Windows, iPadOS
  • Remote OS: Windows 10
  • Remote Architecture: WSL2 running Ubuntu 20.04, ZSH (same issue with Bash)
  • code-server --version: 3.9.3 fe2dc2deb08e378069891b622bb62ad1d261d1b1

Problem description

For reasons I don't understand, a single specific terminal command won't run (silently fails) when executed under code-server's terminal. This does not happen in the 'normal' terminal and does not happen in VS Code's terminal. They are all using exactly the same system (confirmed but entering a command in one, then cycling back through the history in another and confirmed the same commands are executed).

Steps to Reproduce

  1. Install Lando
  2. Run lando version in any terminal (except the terminal of code server) and confirm there is output
  3. Open code server and enter lando version in the terminal and confirm there is no output

Expected

Terminal should output:

$ lando version
$ v3.1.2

Actual

There is no output after running the command:

$ lando version

An exit code of 4 is shown if $? is entered afterwards

Logs

I ran:

code-server --log debug
and entered the command in the terminal.

1. The most recent files from ~/.local/share/code-server/coder-logs - **There are two files here (stderr, stdout), both empty.**
2. The browser console. **Attached in logs.zip below**
3. The browser network tab. **Attached in logs.zip below**

logs.zip

Screenshot

lando version in the WSL2 terminal:
image

lando version in the code-server terminal:
image

Notes

This issue can be reproduced in VS Code: No, the issue does not happen in VS Code.

@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label May 7, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented May 7, 2021

Okay here are the steps I took to reproduce using macOS + Chrome:

  1. Install Lando v3.1.2 via the dmg file
  2. Open Terminal (macOS default)
  3. Run lando version

image

Now, with code-server:

  1. Run code-server --auth none (code-server 3.9.3 fe2dc2d)
  2. Open localhost:8080/ in Chrome
  3. Open Integrated Terminal
  4. Run lando version

image

Actually...none of the Lando commands are working 🤔 That's very strange.

Lando Docs

Looking a bit further into this, I see these two messages:

If you do not run most of these commands in a directory that contains a Landofile you will likely not get the expected result.

Windows users must use a real, non-emulated, TTY
This is an upstream "restriction" imposed on us by NodeJS and python. We recommend using the shell shipped with Git for Windows but only the cmd.exe variant NOT the one powered by minTTY. That said your safest bet is to use cmd.exe or PowerShell. Other shells may work but have not been tested.

If your shell does not work you will likely see an error message like the input device is not a TTY. See nodejs/node#3006

I don't think that's related but adding here just in case.

Source: Lando CLI docs

Hard to tell if this is specific to code-server or Lando. Let's see if @code-asher or @oxy has any input.

@jsjoeio jsjoeio added this to the Backlog Candidates milestone May 7, 2021
@tanc
Copy link
Author

tanc commented May 7, 2021

@jsjoeio thank you for taking the time to reproduce. It seems strange that Lando commands wouldn’t work in code server but I don’t know enough about the internals to know why.

@jsjoeio
Copy link
Contributor

jsjoeio commented May 7, 2021

Thanks for leaving such clear instructions! It is very strange. I would think it would at least log an error or something. I'm really unsure of what could be happening. Hopefully the others have an idea.

@tanc tanc changed the title One terminal command does not work inside code server but all others do Lando commands fail silently when run from a code-server terminal May 8, 2021
@tanc
Copy link
Author

tanc commented May 8, 2021

I've added a bug report in the Lando repo to cross reference this issue: lando/lando#3000
Also updated the issue title as I think it is specific to Lando.

@oxy
Copy link

oxy commented May 8, 2021

Thanks for the instructions! I just attempted to reproduce it on my Linux build, and it works perfectly fine on both 3.9.3 and on main (which should be 3.10.0 by Monday). I feel like this might be macOS-specific too.

@tanc
Copy link
Author

tanc commented May 8, 2021

Thanks for testing! Interesting... I'm doing this in a Linux environment, using WSL2, so I don't think it's MacOS specific. I'll see if I can test (what will be) 3.10.0 version

@oxy
Copy link

oxy commented May 8, 2021

That's curious - another thing that differed for me was that I was using lando from git instead of the .rpm package because I can't really put docker-ce in the toolbox container I use for dev 🤔

Does using lando from git instead of a release change anything?

@tanc
Copy link
Author

tanc commented May 8, 2021

Ah yes, running the version from git works!

Steps:

  1. git clone https://github.com/lando/lando.git
  2. cd lando
  3. yarn install
  4. Open code server terminal and cd to lando repo
  5. cd bin
  6. ./lando.js version
./lando.js version
v3.1.2

@oxy
Copy link

oxy commented May 8, 2021

That's interesting - looking at commit logs nothing really changed after v3.1.2 was released besides some documentation... 🤔

@tanc
Copy link
Author

tanc commented May 8, 2021

Yes I don't think it's lando code itself... I'm just trying different tags to see if any don't work. I suspect its something about the way its packaged and installed but no idea why that would be an issue at this point.

Confirmed, running off different tags from the source (and doing a yarn install to be sure) doesn't seem to make any difference, the tagged version is correctly displayed in code-server's terminal.

@tanc
Copy link
Author

tanc commented May 8, 2021

I've updated the issue on the Lando side, lets see what the maintainers think over there. A very curious issue!

@stale
Copy link

stale bot commented Nov 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

@stale stale bot added the stale label Nov 6, 2021
@stale stale bot closed this as completed Nov 13, 2021
@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants