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
Fix open_command inside tmux #4520
Conversation
ede9991
to
582662c
Compare
582662c
to
a899e85
Compare
👍 |
I can't reproduce this. The output of which -a open
which -a open_command
nohup --version |
I did not know how to determine the version of nohup command Sorry, I was wrong to write an example. $ tmux
- $ open .
+ $ nohup open .
appending output to nohup.out
$ cat nohup.out
nohup: can't detach from console: No such file or directory |
Oh, then you're not really using open_command. You should do |
@@ -28,7 +29,14 @@ function open_command() { | |||
;; | |||
esac | |||
|
|||
nohup $open_cmd "$@" &>/dev/null | |||
# Use nohup command | |||
if [ ${TMUX:-NOT_USE_TMUX} = "NOT_USE_TMUX" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eiel I think better is:
if [ ${TMUX:-NOT_USE_TMUX} = "NOT_USE_TMUX" ]; then
nohup $open_cmd "$@"
else
$open_cmd "$@"
fi &> /dev/null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcornella @apjanke What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is simply not needed. See #4520 (comment). The current version works correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. Thanks for the quicky reply 👍
This problem is that open_command is not working inside tmux . |
I can reproduce, with OS X 10.9.5, zsh 5.0.2, tmux 2.1. The problem isn't that @eiel is adding an unnecessary For example, here's a fresh
I don't know exactly what the semantics of |
Ok, thanks for chiming in. I see now what he meant. Weirdly, when I tested this on my setup it worked correctly. I'll see if we need this or there is some other alternative that works everywhere though; I think I added the
Try this one-liner instead: $open_cmd "$@" &>/dev/null &| |
I've submitted that change in the form of a commit at mcornella@454e89c. |
Awesome! 🙇 👍 |
Ok, I've submitted #4534 to test separately. +1 there if it works for you |
I want to use
open_command
inside tmux.So, I modified
open_command
what not use nohup command inside tmux.see also: http://stackoverflow.com/questions/23898623/nohup-cant-detach-from-console#comment36797854_23898623