Code Monkey home page Code Monkey logo

Comments (8)

alexeyr-ci avatar alexeyr-ci commented on June 17, 2024 1

but not when passing commands directly as an argument.

That's the expected behavior according to #816 (comment) (unless it was changed later, the comment is from 2017):

As of build 16188 when running bash.exe without arguments (or with the ~ argument) bash will be launched as a login shell. The same is true for the new wsl.exe binary (with the exception that wsl launches your user's default shell as a login shell).

from wsl.

github-actions avatar github-actions commented on June 17, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

from wsl.

pmartincic avatar pmartincic commented on June 17, 2024

I don't see what you see when I test. Can you post your ~/.wslconfig & /etc/wsl.conf

Typically, we like logs from here: https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method

from wsl.

alexeyr-ci avatar alexeyr-ci commented on June 17, 2024

Sorry, I was going to include them but forgot.

~/.wslconfig

[wsl2]
memory=16GB
processors=4

[experimental]
autoMemoryReclaim=gradual
sparseVhd=true

/etc/wsl.conf:

[boot]
systemd=true

[user]
default=alexey

Logs: WslLogs-2024-02-14_01-15-52.zip.

from wsl.

JojOatXGME avatar JojOatXGME commented on June 17, 2024

For me, it works when I open a "normal" interactive shell,

> wsl.exe -d Ubuntu
$ shopt login_shell
login_shell     on
$ whereis vlc
vlc: /snap/bin/vlc

but not when passing commands directly as an argument.

> wsl.exe -d Ubuntu -- shopt login_shell
login_shell     off
> wsl.exe -d Ubuntu -- whereis vlc
vlc:
> wsl.exe -d Ubuntu -- vlc
/bin/bash: line 1: vlc: command not found

I installed VLC as a snap to reproduce the issue. Snaps are installed within /snap/bin/

$ sudo snap install vlc
vlc 3.0.19 from VideoLAN✓ installed

from wsl.

JojOatXGME avatar JojOatXGME commented on June 17, 2024

@alexeyr-ci Thanks for the info. I guess it makes sense, as it seems to match the behavior of sshd.

$ ssh 172.31.192.139 shopt login_shell
login_shell     off

Unfortunately, in my case with NixOS, the distro is not using the standard paths, so I end up with almost nothing in the PATH, not even bash or ls. 😆 (I am not sure how they fixed the initial environment when connecting over ssh.) I cannot help you with your issue then.

from wsl.

OneBlue avatar OneBlue commented on June 17, 2024

I indeed cannot reproduce the issue:

wsl --shell-type login
$ shopt login_shell
login_shell     on

@alexeyr-ci: Can you share details about your distro and default shell ?

from wsl.

alexeyr-ci avatar alexeyr-ci commented on June 17, 2024

The distro is Ubuntu, and the shell is bash. Nothing special here.

from wsl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.