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

fzf-tmux not working #305

Closed
mclearc opened this issue Jul 28, 2015 · 5 comments
Closed

fzf-tmux not working #305

mclearc opened this issue Jul 28, 2015 · 5 comments
Labels

Comments

@mclearc
Copy link

mclearc commented Jul 28, 2015

Here's the error message:

fatal error: unexpected signal during runtime execution                                                                                                                       [42/42]
[signal 0xb code=0x1 addr=0x304 pc=0x7fff8bf99aad]

runtime stack:
runtime.gothrow(0x41b2d70, 0x2a)
        /usr/local/Cellar/go/1.4.2/libexec/src/runtime/panic.go:503 +0x8e
runtime.sigpanic()
        /usr/local/Cellar/go/1.4.2/libexec/src/runtime/sigpanic_unix.go:14 +0x5e

goroutine 8 [syscall, locked to thread]:
runtime.cgocall_errno(0x4001850, 0xc208057930, 0x0)
        /usr/local/Cellar/go/1.4.2/libexec/src/runtime/cgocall.go:130 +0xf5 fp=0xc208057910 sp=0xc2080578e8
github.com/junegunn/fzf/src/curses._Cfunc_noecho(0x0)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/curses/:122 +0x4b fp=0xc208057930 sp=0xc208057910
github.com/junegunn/fzf/src/curses.Init(0xc20801e2a0, 0xc208020100)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/curses/curses.go:265 +0x175 fp=0xc2080579d8 sp=0xc208057930
github.com/junegunn/fzf/src.func·022()
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/terminal.go:219 +0x46 fp=0xc2080579f0 sp=0xc2080579d8
github.com/junegunn/fzf/src.(*Terminal).Loop(0xc208076000)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/terminal.go:704 +0x143 fp=0xc208057fd8 sp=0xc2080579f0
runtime.goexit()
        /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc208057fe0 sp=0xc208057fd8
created by github.com/junegunn/fzf/src.Run
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/core.go:189 +0xaf8

goroutine 1 [semacquire]:
sync.(*Cond).Wait(0xc20802a040)
        /usr/local/Cellar/go/1.4.2/libexec/src/sync/cond.go:62 +0x9e
github.com/junegunn/fzf/src/util.(*EventBox).Wait(0xc20801e000, 0xc208050f38)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/util/eventbox.go:32 +0xaf
github.com/junegunn/fzf/src.Run(0xc208056000)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/core.go:259 +0xc74
main.main()
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/fzf/main.go:6 +0x2c

goroutine 5 [syscall]:
os/signal.loop()
        /usr/local/Cellar/go/1.4.2/libexec/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
        /usr/local/Cellar/go/1.4.2/libexec/src/os/signal/signal_unix.go:27 +0x35

goroutine 6 [syscall]:                                                                                                                                                        [21/62]
syscall.Syscall(0x3, 0x3, 0xc20800f000, 0x1000, 0xc20801e5e0, 0x4123060, 0x1)
        /usr/local/Cellar/go/1.4.2/libexec/src/syscall/asm_darwin_amd64.s:20 +0x5
syscall.read(0x3, 0xc20800f000, 0x1000, 0x1000, 0xc20803a840, 0x0, 0x0)
        /usr/local/Cellar/go/1.4.2/libexec/src/syscall/zsyscall_darwin_amd64.go:970 +0x6e
syscall.Read(0x3, 0xc20800f000, 0x1000, 0x1000, 0x40307bc, 0x0, 0x0)
        /usr/local/Cellar/go/1.4.2/libexec/src/syscall/syscall_unix.go:136 +0x58
os.(*File).read(0xc2080ae000, 0xc20800f000, 0x1000, 0x1000, 0xc20804cc50, 0x0, 0x0)
        /usr/local/Cellar/go/1.4.2/libexec/src/os/file_unix.go:191 +0x86
os.(*File).Read(0xc2080ae000, 0xc20800f000, 0x1000, 0x1000, 0x60, 0x0, 0x0)
        /usr/local/Cellar/go/1.4.2/libexec/src/os/file.go:95 +0x91
bufio.(*Reader).fill(0xc20802e1e0)
        /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:97 +0x1ce
bufio.(*Reader).ReadSlice(0xc20802e1e0, 0x100a, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:295 +0x257
bufio.(*Reader).ReadBytes(0xc20802e1e0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:374 +0xd2
bufio.(*Reader).ReadString(0xc20802e1e0, 0xc2080ae00a, 0x0, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:414 +0x58
github.com/junegunn/fzf/src.(*Reader).feed(0xc20801e040, 0x4411ae8, 0xc2080ae000)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/reader.go:40 +0x6b
github.com/junegunn/fzf/src.(*Reader).readFromCommand(0xc20801e040, 0x41b7f30, 0x4c)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/reader.go:71 +0x1ac
github.com/junegunn/fzf/src.(*Reader).ReadSource(0xc20801e040)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/reader.go:26 +0x86
created by github.com/junegunn/fzf/src.Run
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/core.go:134 +0x67b

goroutine 7 [semacquire]:
sync.(*Cond).Wait(0xc20802a0c0)
        /usr/local/Cellar/go/1.4.2/libexec/src/sync/cond.go:62 +0x9e
github.com/junegunn/fzf/src/util.(*EventBox).Wait(0xc20801e060, 0xc208019780)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/util/eventbox.go:32 +0xaf
github.com/junegunn/fzf/src.(*Matcher).Loop(0xc20803a660)
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/matcher.go:67 +0x75
created by github.com/junegunn/fzf/src.Run
        /Users/jg/gosrc/src/github.com/junegunn/fzf/src/core.go:184 +0xa7d

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:2232 +0x1

@mclearc
Copy link
Author

mclearc commented Jul 28, 2015

Here's my tmux.conf

@junegunn
Copy link
Owner

Thanks for the report. Can you check if the following patch to fzf-tmux helps?

diff --git a/bin/fzf-tmux b/bin/fzf-tmux
index c723288..72ed1a7 100755
--- a/bin/fzf-tmux
+++ b/bin/fzf-tmux
@@ -107,7 +107,7 @@ fail() {
 fzf="$(which fzf 2> /dev/null)" || fzf="$(dirname "$0")/fzf"
 [ -x "$fzf" ] || fail "fzf executable not found"

-envs="env "
+envs="env TERM=$TERM "
 [ -n "$FZF_DEFAULT_OPTS"    ] && envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")"
 [ -n "$FZF_DEFAULT_COMMAND" ] && envs="$envs FZF_DEFAULT_COMMAND=$(printf %q "$FZF_DEFAULT_COMMAND")"

@mclearc
Copy link
Author

mclearc commented Jul 28, 2015

Nice fix! That seems to have done the trick. Thanks again!

@mclearc mclearc closed this as completed Jul 28, 2015
@junegunn
Copy link
Owner

Great, thanks for your assistance, I'll push the fix to master.

junegunn added a commit that referenced this issue Jul 28, 2015
Fix #305. ncurses can crash on invalid $TERM. fzf-tmux uses bash on
a new pane so we have to make sure that the $TERM is consistent with
that of the hosting shell.
junegunn added a commit that referenced this issue Jul 28, 2015
@junegunn
Copy link
Owner

Updated fzf-tmux to inherit the TERM value of the hosting shell and also updated fzf to gracefully stop on invalid $TERM. If you used Homebrew to install fzf, you can brew reinstall fzf --HEAD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants