zsh has no /snap/bin in PATH

Bug #1637220 reported by Andrea Bernabei
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Triaged
Medium
Unassigned
zsh (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Environment:
XPS13 laptop, just upgraded from Yakkey to Zesty
snapd version 2.16+160.10ubuntu1
ubuntu-core version 16.04.1 r423

How to reproduce:
1) sudo snap install --edge --devmode ubuntu-calendar-app
2) run ubuntu-calendar-app (or ubuntu-calendar-app.ubuntu-calendar-app)

Expected outcome:
The app runs

Actual outcome:
"Command not found"

Additional info:
The app runs successfully if started with "snap run ubuntu-calendar-app"

Revision history for this message
Oliver Grawert (ogra) wrote :

looks like /snap/bin is not in your PATH ... did you already log out/in after the upgrade ?
(IIRC snaps puts a /etc/profile.d snippet in place to add to the PATH, that only gets processed on login)

Revision history for this message
Andrea Bernabei (faenil) wrote :

I have the snippet in /etc/profile.d, but /snap/bin is not in the PATH

Revision history for this message
Andrea Bernabei (faenil) wrote :

(Yes, I have already rebooted a few times after the upgrade)

Michael Vogt (mvo)
summary: - Command not found when launching snaps via terminal on Zesty
+ zsh has no /snap/bin in PATH
Changed in snapd (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in zsh (Ubuntu):
status: New → Confirmed
Revision history for this message
Axel Beckert (xtaran) wrote :

zsh sources /etc/zsh/zprofile by default. /etc/profile (and hence /etc/profile.d/) is only sourced in zsh's compatibility mode, i.e. when zsh is called as sh or ksh. At least Debian does not provide such symlinks and does not plan to do so in the future. (In contrary, Debian deliberately stopped being advertised as ksh alternative. And it never was advertised as /bin/sh alternative as the compatibility is not good enough for that, and also not meant to be good enough by upstream.)

Zsh in Debian has not (yet) implemented something like e.g. /etc/zsh/zprofile.d/ or so. So there's currently no way to add zprofile snippets via other packages. (Zsh in Debian though supports per-package vendor functions and completions.)

So from my point of view the only way to solve this issue from the zsh side is to provide a means for other packages to add snippets to zprofile. Once that's done, snapd needs to add an according snippet for zsh, too.

As a workaround, zsh users should update their $PATH manually in either /etc/zsh/zprofile (exists, only comments) or (as far as I can see) ~/.zprofile.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.