-
Notifications
You must be signed in to change notification settings - Fork 21
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
zsh: command not found: xit #1
Comments
@yang-ling I don't know what the If your terminal needs any special inputs for exiting, I would probably add a separate if for it. @jlipps I was experiencing this same problem out of the box (having to run the command multiple times), is there a particular reason to try C-c before typing exit on the shell? This is how my modified version looks right now and it's working beatifully! Also, thanks @jlipps this is great! function safe_end_procs {
old_ifs="$IFS"
IFS=$'\n'
panes=$(tmux list-panes -s -F "#{pane_id} #{pane_current_command}")
for pane_set in $panes; do
pane_id=$(echo "$pane_set" | awk -F " " '{print $1}')
pane_proc=$(echo "$pane_set" | awk -F " " '{print tolower($2)}')
cmd="C-c"
if [[ "$pane_proc" == "vim" ]]; then
cmd='":qa" Enter'
elif [[ "$pane_proc" == "man" ]] || [[ "$pane_proc" == "less" ]]; then
cmd='"q"'
elif [[ "$pane_proc" == "bash" ]] || [[ "$pane_proc" == "zsh" ]] || [[ "$pane_proc" == "fish" ]]; then
cmd='"exit" Enter'
elif [[ "$pane_proc" == "ssh" ]]; then
cmd='Enter "~."'
fi
echo $cmd | xargs tmux send-keys -t "$pane_id"
done
IFS="$old_ifs"
} |
@jhenriquez |
Oh! It makes sense now. I still don't think the C-c is needed if I'm Thanks @yang-ling! On Wed, Aug 26, 2015, 9:43 PM SpicyCat notifications@github.com wrote:
|
I'd merge this as a PR @yang-ling! Agree with @jhenriquez I'm not sure if we still need the "C-c" (maybe I was being overly protective?) but there may have been a good reason it's there so I'm fine keeping it. |
Another try at "xit not found" error (fix #1)
I got this error when I use this plugin.
I have tried to fix it. In
safekill.sh
I changed it to
And everything goes well.
I also tried to change it to
An extra space is added before
exit
. In this case, no error happens but I need execute C twice to completely kill the session.Currently I don't know the reason.
In one word,
cmd='C-c C-u "exit" Enter'
solves my problem. But I don't know whether it is an elegant solution.My environment information:
The text was updated successfully, but these errors were encountered: