jamesob / desk

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

command not found #48

Closed MrMitch closed 8 years ago

MrMitch commented 8 years ago

I have installed desk from git and just pulled the latest version (0.3.2). Whenever i try to use desk go <desk_name>, i get the following error :

mitch@mitchbox desk go dash
/home/mitch/bin/desk: line 105: : command not found
jamesob commented 8 years ago

Hey, @MrMitch, thanks for the report. Could you do me a favor and attach some additional information like which shell you're running (with version), operating system, etc.? I'm unable to reproduce on OS X and Linux in zsh.

MrMitch commented 8 years ago

I'm on Ubuntu 15.10, my shell is Bash (GNU bash, version 4.3.42(1)-release (x8664-pc-linux-gnu)) and ~/.desk/desks is a symlink to another folder. I've not set any `$DESK*related var in my.bashrc` file, the only desk related lines in it are the following :

# Hook for desk activation
[ ! -z "$DESK_ENV" ] && source "$DESK_ENV"
source /home/mitch/bin/desk-src/shell_plugins/bash/desk

Hope this helps, feel free to ask anything more you might need.

jamesob commented 8 years ago

@MrMitch I'm curious: if you remove "$@" from the end of this line: https://github.com/jamesob/desk/blob/master/desk#L105, does that resolve the issue?

MrMitch commented 8 years ago

@jamesob no it doesn't, I still get the same message.

jamesob commented 8 years ago

Odd, okay. Two ideas:

In the meantime, I'll try to recreate.

MrMitch commented 8 years ago

I get :

mitch@mitchbox [(09fdbe4...)|BISECTING] git bisect good
803bf37847633e2f685a46a27b11facf22efebec is the first bad commit

803bf37847633e2f685a46a27b11facf22efebec

MrMitch commented 8 years ago

803bf37847633e2f685a46a27b11facf22efebec has two parents, 15919e99ded03c6ceea9ff98558e77a322a4dadb which is fine and 09fdbe4612066cf63ea46aee43c7cfaaff02ecfb which is also fine

MrMitch commented 8 years ago

adding echo $SHELL_EXEC prints a new empty line. It seems get_running_shell has trouble detecting the shell I use. FYI, echo $SHELL prints /bin/bash

MrMitch commented 8 years ago

strange thing : I'm using Guake (0.7.2) as terminal. I went and tried desk in Gnome Terminal and it works fine!

MrMitch commented 8 years ago

complementary issue Guake/guake#677 filed

jamesob commented 8 years ago

Interesting... thanks for the opening the Guake issue. Happy to modify https://github.com/jamesob/desk/commit/803bf37847633e2f685a46a27b11facf22efebec#diff-b506e098cf253ce028b8ba0a5fc7d473R167 to get this to work for Guake.

MrMitch commented 8 years ago

looking at the get_running_shell function, it seems that $CMDLINE_FILE points to a file which content is -, so because of the -e 's/^-//' part on line 257, $CMDLINE_SHELL is empty, which is why get_running_shell returns an empty value, causing the command not found message.

ericksonjoseph commented 8 years ago

Hey I found an issue related to this one. get_running_shell was returning 3182. Im using bash on OSX "/usr/local/bin/desk: line 133: 3182: command not found"

Quick Fix:

local SHELL_EXEC="$(get_running_shell)"

local SHELL_EXEC="/bin/bash"

drobati commented 7 years ago

I came across this issue with hyper.app as a terminal. It worked fine in terminal.app for me.