Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fzf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
fzf
Commits
329de8f4
Unverified
Commit
329de8f4
authored
7 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
[fzf-tmux] Execute trap with bash instead of the default shell
Close #1007
parent
e825b07e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/fzf-tmux
+8
-6
8 additions, 6 deletions
bin/fzf-tmux
with
8 additions
and
6 deletions
bin/fzf-tmux
+
8
−
6
View file @
329de8f4
...
...
@@ -146,6 +146,7 @@ cleanup() {
fi
if
[
$#
-gt
0
]
;
then
trap
- EXIT
exit
130
fi
}
...
...
@@ -170,21 +171,22 @@ for arg in "${args[@]}"; do
done
pppid=
$$
trap_set=
"trap 'kill -SIGUSR1 -
$pppid
' EXIT SIGINT SIGTERM
"
trap_un
se
t
=
"trap - EXIT SIGINT SIGTERM"
echo -n
"trap 'kill -SIGUSR1 -
$pppid
' EXIT SIGINT SIGTERM
;"
>
$argsf
clo
se=
"
;
trap - EXIT SIGINT SIGTERM
$close
"
if [[ -n
"
$term
"
]] || [[ -t 0 ]]; then
cat <<<
"
\"
$fzf
\"
$opts
>
$fifo2
; echo
\$
? >
$fifo3
$close
"
>
$argsf
cat <<<
"
\"
$fzf
\"
$opts
>
$fifo2
; echo
\$
? >
$fifo3
$close
"
>>
$argsf
cat
$argsf
TMUX=
$(
echo
$TMUX
|
cut
-d
,
-f
1,2
)
tmux set-window-option synchronize-panes off \;\
set-window-option remain-on-exit off \;\
split-window
$opt
"
$trap_set
;
cd
$(
printf
%q
"
$PWD
"
)
;
$envs
bash
$argsf
;
$trap_unset
"
$swap
\
split-window
$opt
"cd
$(
printf
%q
"
$PWD
"
)
;
$envs
bash
$argsf
"
$swap
\
> /dev/null 2>&1
else
mkfifo
$fifo1
cat <<<
"
\"
$fzf
\"
$opts
<
$fifo1
>
$fifo2
; echo
\$
? >
$fifo3
$close
"
>
$argsf
cat <<<
"
\"
$fzf
\"
$opts
<
$fifo1
>
$fifo2
; echo
\$
? >
$fifo3
$close
"
>
>
$argsf
TMUX=
$(
echo
$TMUX
|
cut
-d
,
-f
1,2
)
tmux set-window-option synchronize-panes off \;\
set-window-option remain-on-exit off \;\
split-window
$opt
"
$
trap_set
;
$
envs
bash
$argsf
;
$trap_unset
"
$swap
\
split-window
$opt
"
$envs
bash
$argsf
"
$swap
\
> /dev/null 2>&1
cat <&0 >
$fifo1
&
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment