deliver slash commands typed so the Claude TUI runs them

The composer routed everything through tmux paste-buffer -p (bracketed
paste), and Claude's TUI deliberately doesn't parse a leading slash on
pasted input — so /command and /skill arrived as literal text instead of
running. Now a recognised command (single-line, leading slash, token in
ClaudeConfig's slash list) is delivered via send-keys -l (typed) so the
TUI fires it; everything else keeps the bracketed-paste path, which also
leaves a stray leading slash (e.g. a /tmp path) as literal text rather
than mis-parsing it. The slash list is warmed lazily when a Claude pane
opens so custom commands are recognised.

T-153.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-23 12:35:53 +02:00
co-authored by Claude Opus 4.7
parent 0a781de0cd
commit 5fad8dc430
8 changed files with 109 additions and 1 deletions
@@ -124,4 +124,14 @@ void main() {
]);
});
});
group('sendCommand', () {
test('types the text literally (no bracketed paste) then submits Enter', () async {
await tmux.sendCommand('clide-claude-foo', '/whats-next');
expect(runner.calls, [
['-L', 'clide', 'send-keys', '-t', 'clide-claude-foo', '-l', '--', '/whats-next'],
['-L', 'clide', 'send-keys', '-t', 'clide-claude-foo', 'Enter'],
]);
});
});
}