fish-shell/tests/checks/status-command.fish
Johannes Altmanninger 8bf8b10f68 Extended & human-friendly keys
See the changelog additions for user-visible changes.

Since we enable/disable terminal protocols whenever we pass terminal ownership,
tests can no longer run in parallel on the same terminal.

For the same reason, readline shortcuts in the gdb REPL will not work anymore.
As a remedy, use gdbserver, or lobby for CSI u support in libreadline.

Add sleep to some tests, otherwise they fall (both in CI and locally).

There are two weird failures on FreeBSD remaining, disable them for now
https://github.com/fish-shell/fish-shell/pull/10359/checks?check_run_id=23330096362

Design and implementation borrows heavily from Kakoune.

In future, we should try to implement more of the kitty progressive
enhancements.

Closes #10359
2024-04-02 14:35:16 +02:00

58 lines
1.2 KiB
Fish

#RUN: env FISH_PATH=%fish FILE_PATH=%s %fish %s | %filter-ctrlseqs
status line-number
# CHECK: 3
# Check status fish-path
# No output expected on success
#
# argv[0] on OpenBSD is just the filename, not the path
# That means fish-path is unsupportable there.
if not contains (uname) OpenBSD
set status_fish_path (realpath (status fish-path))
set env_fish_path (realpath $FISH_PATH)
test "$status_fish_path" = "$env_fish_path"
or echo "Fish path disagreement: $status_fish_path vs $env_fish_path"
end
# Check is-block
status is-block
echo $status
begin
status is-block
echo $status
end
# CHECK: 1
# CHECK: 0
# Check filename
set status_filename (status filename)
test (status filename) = "$FILE_PATH"
or echo "File path disagreement: $status_filename vs $FILE_PATH"
function print_my_name
status function
end
print_my_name
# CHECK: print_my_name
status is-command-substitution
echo $status
echo (status is-command-substitution; echo $status)
# CHECK: 1
# CHECK: 0
test (status filename) = (status dirname)/(status basename)
status basename
#CHECK: status-command.fish
status dirname | string match -q '*checks'
echo $status
#CHECK: 0
echo "status dirname" | source
#CHECK: .
$FISH_PATH -c 'status dirname'
#CHECK: Standard input