Skip to content

Commit

Permalink
Add hidecursorinactive option to indicate status when terminal loses …
Browse files Browse the repository at this point in the history
…focus (#965)

* Enable focus events through configuration by using focus (option) and on-ui-enter/on-ui-exit events.

* Revert doc

This reverts commit 77f1136.

* Revert rune evt

This reverts commit 77f1136.

* hidecursorinactive with tcell

* cleanup

* cleanup
  • Loading branch information
laktak authored Dec 26, 2023
1 parent 2a4adb3 commit 075caac
Show file tree
Hide file tree
Showing 8 changed files with 819 additions and 998 deletions.
1 change: 1 addition & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func run() {
if gOpts.mouse {
screen.EnableMouse()
}
screen.EnableFocus()

if gLogPath != "" {
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
Expand Down
3 changes: 3 additions & 0 deletions complete.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ var (
"cursoractivefmt",
"cursorparentfmt",
"cursorpreviewfmt",
"hidecursorinactive",
"nohidecursorinactive",
"hidecursorinactive!",
"dircache",
"nodircache",
"dircache!",
Expand Down
131 changes: 68 additions & 63 deletions doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,69 +136,70 @@ The following command line commands are provided by lf:

The following options can be used to customize the behavior of lf:

anchorfind bool (default true)
autoquit bool (default false)
borderfmt string (default "\033[0m")
cleaner string (default '')
cursoractivefmt string (default "\033[7m")
cursorparentfmt string (default "\033[7m")
cursorpreviewfmt string (default "\033[4m")
dircache bool (default true)
dircounts bool (default false)
dirfirst bool (default true)
dironly bool (default false)
dirpreviews bool (default false)
drawbox bool (default false)
dupfilefmt string (default '%f.~%n~')
errorfmt string (default "\033[7;31;47m")
filesep string (default "\n")
findlen int (default 1)
globsearch bool (default false)
hidden bool (default false)
hiddenfiles []string (default '.*')
history bool (default true)
icons bool (default false)
ifs string (default '')
ignorecase bool (default true)
ignoredia bool (default true)
incfilter bool (default false)
incsearch bool (default false)
info []string (default '')
infotimefmtnew string (default 'Jan _2 15:04')
infotimefmtold string (default 'Jan _2 2006')
mouse bool (default false)
number bool (default false)
numberfmt string (default "\033[33m")
period int (default 0)
preserve []string (default "mode")
preview bool (default true)
previewer string (default '')
promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m")
ratios []int (default '1:2:3')
relativenumber bool (default false)
reverse bool (default false)
ruler []string (default 'acc:progress:selection:filter:ind')
rulerfmt string (default " %a| %p| \033[7;31m %m \033[0m| \033[7;33m %c \033[0m| \033[7;35m %s \033[0m| \033[7;34m %f \033[0m| %i/%t")
scrolloff int (default 0)
selmode string (default 'all')
shell string (default 'sh' for Unix and 'cmd' for Windows)
shellflag string (default '-c' for Unix and '/c' for Windows)
shellopts []string (default '')
sixel bool (default false)
smartcase bool (default true)
smartdia bool (default false)
sortby string (default 'natural')
statfmt string (default "\033[36m%p\033[0m| %c| %u| %g| %S| %t| -> %l")
tabstop int (default 8)
tagfmt string (default "\033[31m")
tempmarks string (default '')
timefmt string (default 'Mon Jan _2 15:04:05 2006')
truncatechar string (default '~')
truncatepct int (default 100)
waitmsg string (default 'Press any key to continue')
wrapscan bool (default true)
wrapscroll bool (default false)
user_{option} string (default none)
anchorfind bool (default true)
autoquit bool (default false)
borderfmt string (default "\033[0m")
cleaner string (default '')
cursoractivefmt string (default "\033[7m")
cursorparentfmt string (default "\033[7m")
cursorpreviewfmt string (default "\033[4m")
dircache bool (default true)
dircounts bool (default false)
dirfirst bool (default true)
dironly bool (default false)
dirpreviews bool (default false)
drawbox bool (default false)
dupfilefmt string (default '%f.~%n~')
errorfmt string (default "\033[7;31;47m")
filesep string (default "\n")
findlen int (default 1)
globsearch bool (default false)
hidden bool (default false)
hiddenfiles []string (default '.*')
hidecursorinactive bool (default false)
history bool (default true)
icons bool (default false)
ifs string (default '')
ignorecase bool (default true)
ignoredia bool (default true)
incfilter bool (default false)
incsearch bool (default false)
info []string (default '')
infotimefmtnew string (default 'Jan _2 15:04')
infotimefmtold string (default 'Jan _2 2006')
mouse bool (default false)
number bool (default false)
numberfmt string (default "\033[33m")
period int (default 0)
preserve []string (default "mode")
preview bool (default true)
previewer string (default '')
promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m")
ratios []int (default '1:2:3')
relativenumber bool (default false)
reverse bool (default false)
ruler []string (default 'acc:progress:selection:filter:ind')
rulerfmt string (default " %a| %p| \033[7;31m %m \033[0m| \033[7;33m %c \033[0m| \033[7;35m %s \033[0m| \033[7;34m %f \033[0m| %i/%t")
scrolloff int (default 0)
selmode string (default 'all')
shell string (default 'sh' for Unix and 'cmd' for Windows)
shellflag string (default '-c' for Unix and '/c' for Windows)
shellopts []string (default '')
sixel bool (default false)
smartcase bool (default true)
smartdia bool (default false)
sortby string (default 'natural')
statfmt string (default "\033[36m%p\033[0m| %c| %u| %g| %S| %t| -> %l")
tabstop int (default 8)
tagfmt string (default "\033[31m")
tempmarks string (default '')
timefmt string (default 'Mon Jan _2 15:04:05 2006')
truncatechar string (default '~')
truncatepct int (default 100)
waitmsg string (default 'Press any key to continue')
wrapscan bool (default true)
wrapscroll bool (default false)
user_{option} string (default none)

The following environment variables are exported for shell commands:

Expand Down Expand Up @@ -755,6 +756,10 @@ Patterns can be given as relative or absolute paths.
Globbing supports the usual special characters, `*` to match any sequence, `?` to match any character, and `[...]` or `[^...]` to match character sets or ranges.
In addition, if a pattern starts with `!`, then its matches are excluded from hidden files. To add multiple patterns, use `:` as a separator. Example: `.*:lost+found:*.bak`

## hidecursorinactive (bool) (default false)

Hide the cursor when the terminal or tmux pane loses focus.

## history (bool) (default true)

Save command history.
Expand Down
Loading

0 comments on commit 075caac

Please sign in to comment.