Skip to content

Commit

Permalink
Support for a new variable, main.pager
Browse files Browse the repository at this point in the history
This can be set in the toml file, or via the minibuffer:

set pager "less +G"
set pager "tail -f"
set nopager

This feature will be used to show the termshark logs. If not set,
termshark will use the regular PAGER variable, if set.
  • Loading branch information
gcla committed Jul 19, 2020
1 parent cefaefb commit 6a54009
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ui/lastline.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ func (s setArg) Completions() []string {
"dark-mode",
"disable-shark-fin",
"packet-colors",
"pager",
"nopager",
"term",
"noterm",
}
Expand Down Expand Up @@ -207,6 +209,11 @@ func (d setCommand) Run(app gowid.IApp, args ...string) error {
OpenMessage(fmt.Sprintf("Terminal type is now %s\n(Requires restart)", args[2]), appView, app)
}))
}
case "pager":
termshark.SetConf("main.pager", args[2])
app.Run(gowid.RunFunction(func(app gowid.IApp) {
OpenMessage(fmt.Sprintf("Pager is now %s", args[2]), appView, app)
}))
default:
err = invalidSetCommandErr
}
Expand All @@ -217,6 +224,11 @@ func (d setCommand) Run(app gowid.IApp, args ...string) error {
app.Run(gowid.RunFunction(func(app gowid.IApp) {
OpenMessage("Terminal type is now unset\n(Requires restart)", appView, app)
}))
case "nopager":
termshark.DeleteConf("main.pager")
app.Run(gowid.RunFunction(func(app gowid.IApp) {
OpenMessage("Pager is now unset", appView, app)
}))
default:
err = invalidSetCommandErr
}
Expand Down

0 comments on commit 6a54009

Please sign in to comment.