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

The new session shell there are many options #243

Open
yang-kai-shuo opened this issue Oct 27, 2021 · 15 comments
Open

The new session shell there are many options #243

yang-kai-shuo opened this issue Oct 27, 2021 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@yang-kai-shuo
Copy link

The new session is as shown,how to du
image

@kingToolbox
Copy link
Owner

Judging from the screenshot, it should be that there was a problem with WindTerm when importing the WSL list in the system.

Because I don't have your environment, would you like to help me execute wsl -l from the directory WindTerm_install_path in your environment and paste the output here? WindTerm usually obtains a list of installed Linux Distributions by executing this command and capturing the output. The expected output must be something like the following:

c:\wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
Debian
Kali-linux

Then Ubuntu, Debian and Kali-linux will be extracted from it and a wsl list will be generated. But obviously something went wrong in your environment. This is strange, because it has been working well for several years.If possible, please give your system version and WSL version too. Thank you.

@kingToolbox kingToolbox self-assigned this Oct 27, 2021
@kingToolbox kingToolbox added the bug Something isn't working label Oct 27, 2021
@yang-kai-shuo
Copy link
Author

It's alright!Because I didn't install wsl before,I don't think it is necessary why it appears in the list。。
image
image

@yang-kai-shuo
Copy link
Author

When I delete WSL, it appears in the list -。-||

@kingToolbox
Copy link
Owner

Thank you for your feedback, It seems that the problem has been solved, right? I saw that the list of Linux Distributions can be obtained correctly in your screenshot. 😄

@yang-kai-shuo
Copy link
Author

Thank you, but I don’t want to install wsl and don’t want it to appear in the list, what should I do?😄

@kingToolbox
Copy link
Owner

If you have not installed or have uninstalled wsl, then the list will not be generated. The reason why the list is now generated is because wsl.exe is still found in the paths system32/, sysnative/ and sysWOW64. So if you don't need it, you can delete wsl.exe or rename it.

@kingToolbox
Copy link
Owner

But if you have installed wsl and don't want to generate the list, there is no way now. I can add an option for this, but I don't think it is necessary. What do you think?

@yang-kai-shuo
Copy link
Author

Thank you very much for your reply, if installed wsl, there is no need to delete it. I don't install wsl, but there is in system32/, this may be the cause of the problem

@kingToolbox
Copy link
Owner

Yes, this is the problem, you don't use or even uninstalled wsl.exe, but wsl.exe is still there. If possible, you can execute wsl -l and post the output. I will see what the output looks like when no Linux Distribution is installed, and judge whether it can be filtered out during parsing. But you know, these outputs are localized strings. Since I can't filter for a certain language, I'm not sure that this is the perfect solution.

If you have a better idea, or if you think we don't need to make any changes, you can tell me. Thank you.

@yang-kai-shuo
Copy link
Author

image
This is the output effect,However, I can't think of a good way or setting an option to turn off wsl ?mey be。thank you

@comuslxl
Copy link

comuslxl commented Nov 3, 2021

Yes, this is the problem, you don't use or even uninstalled wsl.exe, but wsl.exe is still there. If possible, you can execute wsl -l and post the output. I will see what the output looks like when no Linux Distribution is installed, and judge whether it can be filtered out during parsing. But you know, these outputs are localized strings. Since I can't filter for a certain language, I'm not sure that this is the perfect solution.

If you have a better idea, or if you think we don't need to make any changes, you can tell me. Thank you.

reture value of $(wsl -l) helps?

@kingToolbox
Copy link
Owner

@comuslxl
Thank you for providing such a good solution, I will try it.

At present I have found a feasible and simple way to detect whether there is wsl.exe in the output. In addition, I changed the search command from wsl -l to wsl --list --quiet, so that the output is more clear.

c:\wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
kali-linux

c:\wsl --list --quiet
Ubuntu
kali-linux

@kingToolbox
Copy link
Owner

The new WindTerm_2.2.0_Prerelease_4 version has been released and this issue has been fixed, please download and check it, thank you.

@ltxhhz
Copy link

ltxhhz commented Dec 1, 2021

@kingToolbox
Hi, I'm sorry to bother you, but the problem hasn't been solved.
It's still like this...
image

This is my version of the system.

版本	Windows 10 专业版
版本号	21H1
安装日期	‎2020/‎9/‎29
操作系统内部版本	19043.1387
体验	Windows Feature Experience Pack 120.2212.3920.0

image

I don't have WSL installed on my computer, but this command works. And running the following commands gives the same result:

PS C:\Users\12708> wsl

版权所有 (c) Microsoft Corporation。保留所有权利。

用法:wsl.exe [参数]


    --install <选项>
        安装适用于 Linux 的 Windows 子系统功能。如果未指定任何选项,
        则将安装推荐功能以及默认分发。

        若要查看默认分发以及其他有效分发的列表,
        请使用“wsl --list --online”。

        选项:
            --distribution, -d [参数]
                通过名称指定要下载和安装的分发。

                参数:
                    有效的分发名称(不区分大小写)。

                示例:
                    wsl --install -d Ubuntu
                    wsl --install --distribution Debian

    --list, -l [选项]
        列出分发。

        选项:
            --online, -o
                使用“wsl --install”列出可供安装的分发列表。

    --help
        显示使用情况信息。
PS C:\Users\12708> wsl -l

版权所有 (c) Microsoft Corporation。保留所有权利。

用法:wsl.exe [参数]


    --install <选项>
        安装适用于 Linux 的 Windows 子系统功能。如果未指定任何选项,
        则将安装推荐功能以及默认分发。

        若要查看默认分发以及其他有效分发的列表,
        请使用“wsl --list --online”。

        选项:
            --distribution, -d [参数]
                通过名称指定要下载和安装的分发。

                参数:
                    有效的分发名称(不区分大小写)。

                示例:
                    wsl --install -d Ubuntu
                    wsl --install --distribution Debian

    --list, -l [选项]
        列出分发。

        选项:
            --online, -o
                使用“wsl --install”列出可供安装的分发列表。

    --help
        显示使用情况信息。
PS C:\Users\12708> wsl --list --quiet

版权所有 (c) Microsoft Corporation。保留所有权利。

用法:wsl.exe [参数]


    --install <选项>
        安装适用于 Linux 的 Windows 子系统功能。如果未指定任何选项,
        则将安装推荐功能以及默认分发。

        若要查看默认分发以及其他有效分发的列表,
        请使用“wsl --list --online”。

        选项:
            --distribution, -d [参数]
                通过名称指定要下载和安装的分发。

                参数:

                示例:
                    wsl --install -d Ubuntu
                    wsl --install --distribution Debian

    --list, -l [选项]
        列出分发。

        选项:
            --online, -o
                使用“wsl --install”列出可供安装的分发列表。

    --help
        显示使用情况信息。

Except for the command wsl-l --online

PS C:\Users\12708> wsl -l --online
以下是可安装的有效分发的列表。
使默认分发用 “*” 表示。
使用 'wsl --install -d <Distro>' 安装。

  NAME            FRIENDLY NAME
* Ubuntu          Ubuntu
  Debian          Debian GNU/Linux
  kali-linux      Kali Linux Rolling
  openSUSE-42     openSUSE Leap 42
  SLES-12         SUSE Linux Enterprise Server v12
  Ubuntu-16.04    Ubuntu 16.04 LTS
  Ubuntu-18.04    Ubuntu 18.04 LTS
  Ubuntu-20.04    Ubuntu 20.04 LTS

Therefore, we can get a method to determine whether the command was successfully executed (get the exit code for the command):
In powershell:

PS C:\Users\12708> wsl -l --online
以下是可安装的有效分发的列表。
使默认分发用 “*” 表示。
    ...
PS C:\Users\12708> echo $?
True
PS C:\Users\12708> wsl -l

版权所有 (c) Microsoft Corporation。保留所有权利。

用法:wsl.exe [参数]
    ....
PS C:\Users\12708> echo $?
False

In cmd:

C:\Users\12708>wsl -l

版权所有 (c) Microsoft Corporation。保留所有权利。
    ...

C:\Users\12708>echo %errorlevel%
1

C:\Users\12708>wsl -l --online
以下是可安装的有效分发的列表。
使默认分发用 “*” 表示。
...

C:\Users\12708>echo %errorlevel%
0

The software version I am currently using is 2.2.2.
image

I hope you found this useful.

@kingToolbox
Copy link
Owner

This is very strange. Now this error is avoided by detecting whether "wsl.exe" is contained in the output of wsl --list --quite. Judging from the output you gave, it should be filtered out.

I will continue to investigate this issue. The plan you gave is very useful. I have considered it before, but later I felt that the current plan was simpler, so I did not use it. But I will reconsider it, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants