mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-15 17:57:07 +00:00
parent
dce6fe6f2d
commit
02bd2d2adf
@ -8,6 +8,7 @@ package curses
|
|||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
@ -258,6 +259,10 @@ func Init(theme *ColorTheme, black bool, mouse bool) {
|
|||||||
|
|
||||||
C.setlocale(C.LC_ALL, C.CString(""))
|
C.setlocale(C.LC_ALL, C.CString(""))
|
||||||
_screen = C.newterm(nil, C.stderr, C.stdin)
|
_screen = C.newterm(nil, C.stderr, C.stdin)
|
||||||
|
if _screen == nil {
|
||||||
|
fmt.Println("Invalid $TERM: " + os.Getenv("TERM"))
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
C.set_term(_screen)
|
C.set_term(_screen)
|
||||||
if mouse {
|
if mouse {
|
||||||
C.mousemask(C.ALL_MOUSE_EVENTS, nil)
|
C.mousemask(C.ALL_MOUSE_EVENTS, nil)
|
||||||
|
@ -743,6 +743,11 @@ class TestGoFZF < TestBase
|
|||||||
tmux.send_keys :Enter
|
tmux.send_keys :Enter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_invalid_term
|
||||||
|
tmux.send_keys "TERM=xxx fzf", :Enter
|
||||||
|
tmux.until { |lines| lines.any? { |l| l.include? 'Invalid $TERM: xxx' } }
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def writelines path, lines
|
def writelines path, lines
|
||||||
File.unlink path while File.exists? path
|
File.unlink path while File.exists? path
|
||||||
|
Loading…
Reference in New Issue
Block a user