Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/functions.zsh
Expand Up @@ -17,6 +17,7 @@ function take() {

function open_command() {
local open_cmd
local nohup

# define the open command
case "$OSTYPE" in
Expand All @@ -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
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Contributor

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 👍

nohup="nohup"
else
nohup=""
fi

$nohup $open_cmd "$@" &>/dev/null
}

#
Expand Down