jamesob / desk

A lightweight workspace manager for the shell
MIT License
2.54k stars 112 forks source link

desk doesn't seem to execute desk file at all #76

Closed niyue closed 7 years ago

niyue commented 7 years ago

I found desk doesn't work in one of my new machine and I have no idea why this happens.

When I ran desk . ${desk}, a shell is launched but nothing specified in the desk script is executed.

➜  ~ desk ls
j
k
➜  ~ cat ~/.desk/desks/k.sh
cd /tmp
echo "hello"
➜  ~ ps aux | grep zsh
               8530   0.0  0.0  2461752   3744 s003  Ss+   6:04PM   0:00.48 -zsh
              82198   0.0  0.0  2452260   1996 s001  S+    4:24PM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn zsh
              81932   0.0  0.0  2461752   4816 s001  S     4:24PM   0:00.44 -zsh
➜  ~ desk . k
➜  ~ ps aux | grep zsh
               8530   0.0  0.0  2461752   3744 s003  Ss+   6:04PM   0:00.48 -zsh
              82417   0.0  0.0  2460452   2004 s001  S+    4:24PM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn zsh
              82204   0.0  0.0  2462228   4716 s001  S     4:24PM   0:00.17 zsh
              81932   0.0  0.0  2461752   4820 s001  S     4:24PM   0:00.45 -zsh

As you can see in the above:

Not sure if it is relevant, but when using desk run command, date seems to work as expected but echo still doesn't work as I expected and outputs only an empty line.

➜  ~ desk run k date
Tue May  9 16:27:49 CST 2017
➜  ~ desk run k echo "hello"

➜  ~

I am using:

n2aws commented 7 years ago

Not sure if you had figured this out yet or not, but I had the exact same issue. In my case, I used homebrew to install, and according to the docs, if you brew install desk, it automatically sets itself up. However, I already had a pre-existing .desk/desks folder, so I did a "brew install desk" and then copied my .desk dir into place. The issue you list above is exactly to what I experienced. It turns out, the directions are incorrect.

I had to rm -rf ~.desk, and then "desk init" and then copy my .desk directory back into place. turns out, desk init adds the following to the .zshrc:

# Hook for desk activation
[ -n "$DESK_ENV" ] && source "$DESK_ENV" || true

Hope that helps. The documentation should be updated, or the brew install should be fixed to modify the .zshrc