windows_command_processor
This directory provides Talon voice control integration for the classic Windows Command Prompt (cmd.exe). It enables hands-free operation of the terminal, whether running as a standalone legacy console window or hosted inside the modern Windows Terminal application.
The integration is driven by a single key script:
- command_processor_win.py: Implements the context rules, overrides standard Talon actions, and translates cross-platform terminal commands into native Command Prompt instructions.
How It Works
The script leverages Talon's context-matching engine to target active cmd.exe sessions and overrides generic API actions to align with Command Prompt behavior:
- Context & Tags: The configuration matches processes named
windows_command_processor, as well aswindows_terminalinstances that contain "Command Prompt" in their window title. Once active, it binds theterminal,user.file_manager,user.git, anduser.kubectltags, making standard commands for those environments available. - Working Directory Tracking: Standard command shells do not always expose their current working directory to the OS window manager. To solve this, the script implements a title-parsing strategy:
file_manager_refresh_titleexecutestitle Command Prompt: %CD%inside the prompt to force the current directory path into the window's title bar.file_manager_current_pathreads the active window title, cleans up administrative prefixes, and extracts the path so Talon knows where the user is in the filesystem.
- Directory Navigation: Standard file manager commands are converted into Command Prompt syntax. For instance, changing directories executes
cd "<path>"followed by a title refresh, and switching drives is handled by mapping the path directly to the drive volume (e.g.,D:). - Terminal Operations: Common terminal utilities are mapped to their Windows Command Prompt equivalents:
- Listing files maps to
dirordir /a. - Clearing the screen executes
cls. - Aborting running commands triggers
ctrl-cfollowed by an automaticyresponse to safely bypass the "Terminate batch job (Y/N)?" confirmation prompt. - Repeating the last command sends the
uparrow key followed byenter.
- Listing files maps to