Closed bricebasty closed 5 months ago
This is how shell environments are designed to work.
Bash only reads .bashrc
when it's run as a interactive, non-login shell. .bash_profile
is used when it's run as an interactive login shell.
Similar conditions apply for zsh and others.
The common condition is "interactive", but awful.spawn.with_shell
is not an interactive session. Therefore neither of those files are used.
The bash man page explains this in detail in the INVOCATION section.
Thank you for the clarification!
Now, I get that it's supposed to work this way. However, what I still don't quite understand is that I used to never have this problem before. With the same config, same everything. Shell environment somehow was the good one. Not a major issue though.
If you were me in that situation, how would you tackle this problem in the cleanest manner possible? (if not using gtk-launch
). I don't expect any answer if you don't have the time/energy for it though :)
Thanks again and have a great week.
what I still don't quite understand is that I used to never have this problem before. With the same config, same everything
Nothing has changed on AwesomeWM's side, so something else did. But it'd be hard to track down.
If you were me in that situation, how would you tackle this problem in the cleanest manner possible?
Two options:
awful.spawn("run_with_rbenv.sh code")
Thanks a lot!
EDIT:
Been going with launching AwesomeWM in a shell script with environment variables.
start_awesome.sh
in your home
directory
#!/bin/sh
# Set environment variables
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
exec awesome
2. Enter this command in your terminal to open the `desktop` file of AwesomeWM:
`sudo nano /usr/share/xsessions/awesome.desktop`
3. Edit the `desktop` file of AwesomeWM like so: (change `your_username` on line 5)
[Desktop Entry] Name=awesome Comment=Highly configurable framework window manager TryExec=awesome Exec=/home/your_username/start_awesome.sh Type=Application
Clean and configurable.
Output of
awesome --version
:awesome v4.3 (Too long) • Compiled against Lua 5.4.4 (running with 0.9.2) • D-Bus support: ✔ • execinfo support: ✔ • xcb-randr version: 1.6 • LGI version: /usr/share/lua/5.4/lgi/version.lua
How to reproduce the issue:
awful.spawn("code")
orawful.spawn_with_shell("code")
to spawn VSCode.bash_profile
/.bashrc
or.zshrc
)Originally posted by @solowdev in https://github.com/Shopify/ruby-lsp/issues/1216#issuecomment-2146990833
Actual result:
Expected result:
Workaround found:
.desktop
file made everything work. So I usedawful.util.spawn("gtk-launch code.desktop")
instead and no issues so far.This is a minor issue but it can be annoying to deal with.