Allow simple commands to be fired.

This commit is contained in:
Your Name
2026-06-30 10:03:49 +01:00
parent 5f7a4b0f52
commit fcfa0b6db4
11 changed files with 76 additions and 19 deletions

View File

@@ -0,0 +1,3 @@
# Command body unsupported checkpoint.
# Expected at this stage: should parse, then fatal/XXX when invocation reaches ARGS_COMMANDS.
bind-key F1 { display-message "parser command body" }

View File

@@ -0,0 +1,2 @@
display-message "HOME=$HOME"
display-message ~

View File

@@ -0,0 +1,5 @@
# Failure scope test.
# Expected with sequence skipping: bad command fails, following command in same sequence is skipped,
# then next top-level sequence still runs.
display-message "parser failure: before bad command" ; no-such-tmux-command ; display-message "parser failure: should be skipped"
display-message "parser failure: next sequence should still run"

View File

@@ -0,0 +1,10 @@
# %if/%elif/%else.
# Expected: elif branch is selected.
%if 0
display-message "parser elif: selected if branch - wrong"
%elif 1
display-message "parser elif: selected elif branch"
%else
display-message "parser elif: selected else branch - wrong"
%endif
display-message "parser elif: after endif"

View File

@@ -0,0 +1,8 @@
# %if true branch.
# Expected: first branch is selected.
%if 1
display-message "parser if true: selected if branch"
%else
display-message "parser if true: selected else branch - wrong"
%endif
display-message "parser if true: after endif"

View File

@@ -0,0 +1,3 @@
# Inline %if form.
# Expected: inline true branch selected, then following command in same sequence is processed.
display-message "parser inline if: before" ; %if 1 display-message "parser inline if: branch" %endif ; display-message "parser inline if: after"

View File

@@ -0,0 +1,3 @@
# Semicolon sequence.
# Expected: one top-level sequence containing three commands.
set -g status on ; set -g message-style fg=yellow ; display-message "parser semicolon sequence"

View File

@@ -0,0 +1,5 @@
# Simple straight-line commands.
# Expected: all commands parse and run in order.
set -g status off
set -g message-style fg=green
display-message "parser simple: status=#{status}"