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

Document windows challenges #61

Open
na-- opened this issue Jul 16, 2020 · 5 comments
Open

Document windows challenges #61

na-- opened this issue Jul 16, 2020 · 5 comments
Labels
Area: OSS Content Improvements or additions to community/oss documentation Type: needsMaintainerHelp Good issue for k6 maintainers

Comments

@na--
Copy link
Member

na-- commented Jul 16, 2020

As demonstrated by https://community.k6.io/t/warn-0000-error-getting-terminal-size/767 / grafana/k6#1559, k6 has some troubles when running in "git bash" on Windows. We will fix the panic, but the user experience of k6 will never be quite as good there as on other terminals, so we probably should document something like the the following usage guidelines for windows:

If you're using git bash or mintty as your terminal on Windows, you might not get the best user experience out of k6. Consider using a different terminal like Windows Terminal, PowerShell or Cmder. Alternatively, to work around the issues, you can run k6 through winpty, which should already be preinstalled in your Git Bash environment: winpty k6 run script.js.

If you're using the Windows Subsystem for Linux (WSL), you are probably going to get better experience by using the Linux k6 binary above.

For all other cases of running k6 on Windows, the normal k6 Windows binary / .msi package should work fine.

(With the understanding that as soon as we have an official signed package for the windows package manager, that will be the recommended way to install k6.)

cc @imiric

@na--
Copy link
Member Author

na-- commented Jul 16, 2020

The warning that k6 can't get the terminal width / hide password inputs in git bash should probably have another unique error ID (similar to the one we want to have for the "can't open file" error), so it's easily google-able and leads to the explanation for the bad UX in git bash/mintty

@imiric
Copy link
Contributor

imiric commented Jul 16, 2020

Just to add a couple more details:

According to this comment, support for ConPTY, a new Windows API that handles pty emulation much better and should be seamlessly compatible with CLI apps like k6, was added in Cygwin 3.1.0. So in theory the winpty workaround shouldn't be needed anymore in recent versions. Yet when I tried with mintty 3.1.6 (presumably compiled with the same Cygwin version) from Git Bash 2.27.0, it didn't seem to work. Not sure if there's some additional configuration I'm missing, but I didn't see anything relevant (and didn't want to compile mintty myself :)).

So currently the behavior on mintty if #1561 is merged will be:

  • k6 run: An error getting terminal size warning is shown and the progress bars are static and fixed at 80 char width. Otherwise execution works fine.
  • k6 login {cloud,influxdb}: A Stdin is not a terminal, falling back to plain text input warning is shown and the password text input is echoed back to the user. There doesn't seem to be a way to disable echo in the terminal, since golang.org/x/crypto/ssh/terminal doesn't even detect it as such, so we can only read the input without any control over it.

@simskij
Copy link
Contributor

simskij commented Nov 20, 2020

Another alternative is running k6 through WSL2, which effectively would mean it would be running in a seamless Linux VM (usually Ubuntu). This could be a reasonable alternative for more experienced users.

It's definitely how I would run k6 if I were on windows myself. 😅

@simskij simskij added Area: OSS Content Improvements or additions to community/oss documentation Type: Enhancement labels Dec 17, 2020
@ppcano ppcano added the Type: needsMaintainerHelp Good issue for k6 maintainers label Sep 20, 2021
@ppcano
Copy link
Collaborator

ppcano commented Jan 30, 2023

@na-- this issue was created almost 3 years ago. Is this still an issue, any updates on the challenges detailed?

If there are still relevant issues, we could mention them on the Windows installation instructions and detailed them on the list of common installation issues.

@na--
Copy link
Member Author

na-- commented Jan 30, 2023

AFAIK, nothing on either the k6 side or the Windows side has changed, so I assume this is still relevant 🤔 but I haven't been a Windows user in a long while, so I am probably not the right person to ask 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: OSS Content Improvements or additions to community/oss documentation Type: needsMaintainerHelp Good issue for k6 maintainers
Projects
None yet
Development

No branches or pull requests

5 participants