--tmux: Export bash functions

Fix #4001
This commit is contained in:
Junegunn Choi
2024-09-22 00:31:11 +09:00
parent 53bcdc4294
commit 4161403a1d
5 changed files with 50 additions and 23 deletions

View File

@@ -49,9 +49,12 @@ func runTmux(args []string, opts *Options) (int, error) {
tmuxArgs = append(tmuxArgs, "-w"+opts.Tmux.width.String())
tmuxArgs = append(tmuxArgs, "-h"+opts.Tmux.height.String())
return runProxy(argStr, func(temp string) *exec.Cmd {
sh, _ := sh()
return runProxy(argStr, func(temp string, needBash bool) (*exec.Cmd, error) {
sh, err := sh(needBash)
if err != nil {
return nil, err
}
tmuxArgs = append(tmuxArgs, sh, temp)
return exec.Command("tmux", tmuxArgs...)
return exec.Command("tmux", tmuxArgs...), nil
}, opts, true)
}