File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33# return current working directory of tmux pane
4- getPaneDir ()
5- {
4+ getPaneDir () {
65 nextone=" false"
7- for i in $( tmux list-panes -F " #{pane_active} #{pane_current_path}" ) ;
8- do
9- if [ " $nextone " == " true" ]; then
10- echo $i
11- return
12- fi
13- if [ " $i " == " 1" ]; then
14- nextone=" true"
15- fi
6+ ret=" "
7+ for i in $( tmux list-panes -F " #{pane_active} #{pane_current_path}" ) ; do
8+ [ " $i " == " 1" ] && nextone=" true" && continue
9+ [ " $i " == " 0" ] && nextone=" false"
10+ [ " $nextone " == " true" ] && ret+=" $i "
1611 done
12+ echo " ${ret% ?} "
1713}
1814
19- main ()
20- {
15+ main () {
2116 path=$( getPaneDir)
2217
2318 # change '/home/user' to '~'
24- cwd=$( echo $ path | sed " s; $HOME ;~;g " )
19+ cwd=" ${ path/ " $HOME " / ' ~ ' } "
2520
26- echo $cwd
21+ echo " $cwd "
2722}
2823
2924# run main driver program
You can’t perform that action at this time.
0 commit comments