fish-shell/tests
Fabian Homborg c4593828f4
commandline: Add --is-valid option (#8142)
* commandline: Add --is-valid option to query whether it's syntactically complete

This means querying when the commandline is in a state that it could
be executed. Because our `execute` bind function also inserts a
newline if it isn't.

One case that's not handled right now: `execute` also expands
abbreviations, those can technically make the commandline invalid
again.

Unfortunately we have no real way to *check* without doing the
replacement.

Also since abbreviations are only available in command position when
you _execute_ them the commandline will most likely be valid.

This is enough to make transient prompts work:

```fish
function reset-transient --on-event fish_postexec
    set -g TRANSIENT 0
end

function maybe_execute
    if commandline --is-valid
        set -g TRANSIENT 1
        commandline -f repaint
    else
        set -g TRANSIENT 0
    end
    commandline -f execute
end

bind \r maybe_execute
```

and then in `fish_prompt` react to $TRANSIENT being set to 1.
2021-08-14 11:29:22 +02:00
..
checks commandline: Add --is-valid option (#8142) 2021-08-14 11:29:22 +02:00
pexpects Update commandline state before completion 2021-07-27 19:03:35 +02:00
test_functions Resurrect one last function 2020-03-17 21:58:49 +01:00
.gitignore tweak gitignore rules for *tests* directory 2017-02-20 20:29:43 -08:00
history_sample_bash Support $(cmd) command substitution as alternative to (cmd) 2021-07-13 21:33:42 +02:00
history_sample_corrupt1 Improve history robustness against corrupt files 2014-07-29 14:42:03 -07:00
history_sample_fish_1_x Enforce that history items must end with trailing newlines 2021-05-10 14:23:07 -07:00
history_sample_fish_2_0 Enforce that history items must end with trailing newlines 2021-05-10 14:23:07 -07:00
interactive.config Remove some unused functions from the test harness 2020-11-15 09:17:23 +01:00
interactive.fish tests/bind: Skip on Github macOS 2021-05-23 19:46:04 +02:00
test.fish Cleanup test setup a bit 2020-11-15 09:17:23 +01:00
test_util.fish tests: Remove unused colordiff function 2021-01-01 14:18:17 +01:00