Skip to content

mintty

This directory provides integration for the Mintty terminal emulator on Windows, which is commonly used as the terminal backend for Cygwin, MSYS2, and Git Bash.

It contains a single configuration file that adapts Talon's generic terminal, shell, and file manager commands to work seamlessly within Mintty's environment.

Mintty Integration

The core logic is implemented in mintty_win.py, which handles application matching, path translation, and custom keyboard shortcuts.

Application Matching and Tags

Talon recognizes Mintty on Windows by checking for processes named Terminal or mintty.exe. When Mintty is focused, the context activates several tags that enable standard voice command sets: * terminal (generic terminal control) * user.generic_unix_shell (standard Unix command line tools) * user.file_manager (directory navigation and manipulation) * user.git (Git version control commands) * user.kubectl (Kubernetes command line tool)

Path Translation using Cygpath

Because Mintty runs Unix-like environments on top of Windows, file paths are typically formatted in POSIX style (e.g., /cygdrive/c/Users/... or /usr/bin). To allow Talon's file manager actions to understand where the terminal is currently navigated: * A cygpath setting is declared (defaulting to C:\cygwin64\bin\cygpath.exe). * The file_manager_current_path() action extracts the active terminal window's title (which usually displays the current working directory). * It then runs the cygpath.exe utility in a background subprocess to translate this Unix-like path into a standard Windows path that other Windows applications can read.

Overridden Actions

mintty_win.py overrides several default edit and terminal actions to match Mintty's expected input behavior:

  • Clipboard Operations: Maps standard copy and paste actions to Mintty's native ctrl-insert and shift-insert shortcuts.
  • Terminal Navigation: Maps listing actions (terminal_list_directories, terminal_list_all_directories) to ls and directory changes (terminal_change_directory) to cd.
  • Process Control: Translates screen clearing to ctrl-l and process interruption to ctrl-c.