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

Upgrading nushell breaks my i3 config #6203

Open
mfdorst opened this issue Aug 1, 2022 · 9 comments
Open

Upgrading nushell breaks my i3 config #6203

mfdorst opened this issue Aug 1, 2022 · 9 comments
Labels
🐛 bug Something isn't working configuration Issue related to nu's configuration Stale used for marking issues and prs as stale

Comments

@mfdorst
Copy link

mfdorst commented Aug 1, 2022

Describe the bug

When I upgrade from 0.65.0 to 0.66.0, after rebooting, my background is not set and my polybar is not running. After going back to 0.65.0 they work again. I don't know what's causing the problem, but the one commonality I can see is that they're both started using exec_always in my i3 configuration file.

I have no idea how exec_always works in i3, but I guess it must be starting up my default shell because otherwise my version of nushell would have nothing to do with it.

Here are the lines in my i3 config:

# Show desktop background
exec_always --no-startup-id set-wallpaper

# Polybar
exec_always --no-startup-id polybar-launch

Both the set-wallpaper script and the polybar-launch scripts are bash scripts, so they are not themselves invoking nu.

This issue persists on the latest main.

How to reproduce

  1. Install i3
  2. Include an exec_always line in your i3 config (located at ~/.config/i3/config)
    • Example: exec_always --no-startup-id feh --bg-scale /path/to/some/image.png
  3. Log into i3.

Expected behavior

The exec_always line should run on login. (It does not).

In the case of the given example, the background is not set.

Screenshots

No response

Configuration

key value
version 0.66.3
branch
commit_hash 1086fbe
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.62.1 (e092d0b6b 2022-07-16)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.62.1 (a748cf5a3 2022-06-08)
pkg_version 0.66.3
build_time 2022-07-31 18:24:42 -07:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

No response

@merelymyself
Copy link
Contributor

Are you sure this is a nushell issue? Does i3 throw errors?

Related: https://unix.stackexchange.com/questions/302105/feh-and-i3-gaps-not-playing-nicely/325737#325737

@mfdorst
Copy link
Author

mfdorst commented Aug 1, 2022

@merelymyself it works perfectly in 0.65.0, so I think it's unlikely to be an i3 problem.

@mfdorst
Copy link
Author

mfdorst commented Aug 1, 2022

Okay, now I don't know what the hell is going on. I tested with changing my shell to zsh and bash, and it's broken on both of them. I don't understand why nushell 0.65.0 would work but 0.66.0 doesn't and neither do other shells. I guess it is an i3 issue then?

@mfdorst
Copy link
Author

mfdorst commented Aug 1, 2022

Okay, so I've figured out the problem. I was not specifying the full paths to the scripts I was running.

exec_always --no-startup-id set-wallpaper

should have been

exec_always --no-startup-id $HOME/scripts/set-wallpaper

I guess what this means is that i3 was somehow receiving the PATH environment variable from nushell version 0.65.0 and it doesn't receive it anymore on 0.66.0 and later. That brings it inline with zsh, where this also doesn't work unless I specify the full path, so I guess this is not a bug. I'm very curious what might have caused this change though.

@merelymyself
Copy link
Contributor

I’m not 100% sure, but maybe #6150? Either way, does your config work now?

@kubouch
Copy link
Contributor

kubouch commented Aug 1, 2022

Can you post the output of env | get PATH on both 0.65 and 0.66?

@onthebridgetonowhere onthebridgetonowhere added 🐛 bug Something isn't working configuration Issue related to nu's configuration labels Aug 1, 2022
@mfdorst
Copy link
Author

mfdorst commented Aug 1, 2022

@merelymyself yes my configuration does work now that I'm specifying full paths.

@mfdorst
Copy link
Author

mfdorst commented Aug 1, 2022

@kubouch That command didn't work but $env.PATH did.

$env.PATH | to text on 0.65.0:

/home/michael/.cargo/bin
/home/michael/.local/bin
/sbin
/bin
/usr/local/sbin
/usr/local/bin
/usr/bin
/usr/sbin
/var/lib/snapd/snap/bin
/usr/bin/site_perl
/usr/bin/vendor_perl
/usr/bin/core_perl

$env.PATH | to text on 0.66.0:

/home/michael/.cargo/bin
/home/michael/.local/bin
/sbin
/bin
/usr/local/sbin
/usr/local/bin
/usr/bin
/usr/sbin
/var/lib/snapd/snap/bin
/usr/bin/site_perl
/usr/bin/vendor_perl
/usr/bin/core_perl

EDIT: Looks like they're identical, but what's very interesting is that my scripts directory is not in either one. Nonetheless I can call my scripts by name in the shell. I don't know what's going on there.

EDIT 2: I checked env.nu and I do have this line in there.

let-env PATH = ($env.PATH | split row (char esep) | prepend '~/scripts')

So I don't know why it's not showing in my path.

@kubouch
Copy link
Contributor

kubouch commented Aug 2, 2022

Ah, I wrote it wrong. I meant if you could show the PATH after translation to string, i.e., the raw column when running the env command.

@github-actions github-actions bot added the Stale used for marking issues and prs as stale label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working configuration Issue related to nu's configuration Stale used for marking issues and prs as stale
Projects
None yet
Development

No branches or pull requests

4 participants