mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-22 16:24:00 +01:00
Support control-r search for fish
This commit is contained in:
parent
8501e0d16c
commit
49b81bcc19
@ -19,5 +19,16 @@ end
|
||||
|
||||
# TODO: support background commands, see https://github.com/fish-shell/fish-shell/issues/3894
|
||||
|
||||
# TODO: control-r search is currently unsupported for fish
|
||||
[ "$(hishtory config-get enable-control-r)" = true ] && echo "Sorry, hishtory does not currently support overriding control-r for fish"
|
||||
function __hishtory_on_control_r
|
||||
set -l tmp (mktemp -t fish.XXXXXX)
|
||||
set -x init_query (commandline -b)
|
||||
hishtory tquery $init_query > $tmp
|
||||
set -l res $status
|
||||
commandline -f repaint
|
||||
if [ -s $tmp ]
|
||||
commandline -r (cat $tmp)
|
||||
end
|
||||
rm -f $tmp
|
||||
end
|
||||
|
||||
[ "$(hishtory config-get enable-control-r)" = true ] && bind \cr __hishtory_on_control_r
|
@ -75,6 +75,7 @@ func main() {
|
||||
if os.Getenv("HISHTORY_TEST") == "" {
|
||||
fmt.Println("Importing existing shell history...")
|
||||
ctx := hctx.MakeContext()
|
||||
// TODO: skip doing this if this is an update
|
||||
numImported, err := lib.ImportHistory(ctx, false)
|
||||
lib.CheckFatalError(err)
|
||||
if numImported > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user