Skip to content

iterm

The community/apps/iterm directory contains configuration files for the iTerm2 terminal application on macOS. It provides Talon voice commands and integrates with other Talon modules for a more seamless experience.

The primary files in this directory are:

  • iterm.py: This Python file defines the core functionality for iTerm2 within the Talon ecosystem.

    • It starts by creating a Talon Context and Module specifically for iTerm2.
    • It defines the application as matching macOS and the bundle ID com.googlecode.iterm2.
    • It includes an EditActions class that overrides line_start and line_end actions to use the home and end keys, respectively.
    • It also includes a UserActions class that provides several terminal-related actions:
      • tab_jump: Allows jumping to a specific tab using cmd-number.
      • tab_final: Jumps to the last tab with cmd-9.
      • terminal_clear_screen: Clears the terminal screen with ctrl-l.
      • Commented out actions that appear to be related to file management are likely a work in progress, but are intended to provide file manipulation functionality directly in the terminal.
  • iterm.talon: This Talon file enables a set of tags whenever iTerm2 is the active application. These tags enhance the user experience and are used to enable specific sets of commands.

    • It declares the application as running on macOS and having the bundle ID iterm2, similar to the iterm.py file.
    • It activates the terminal, user.generic_unix_shell, user.git, user.kubectl, user.tabs, and user.readline tags when iTerm2 is active.
    • The comment # todo: filemanager support indicates that file manager support via the user.file_manager tag is not yet fully implemented.

In essence, these files work together to provide a richer and more efficient experience when using iTerm2 with Talon. The Python file defines custom actions, while the Talon file activates relevant tags, enabling a more comprehensive set of voice commands and features for terminal interaction.