Skip to main content

Module iterm2

Module iterm2 

Source
Expand description

iTerm2 configuration instruction generator.

Most iTerm2 settings live in plist files, which are complex to modify programmatically, so this module generates manual setup instructions for them. The tab icon is the exception: iTerm2 loads Dynamic Profiles from plain JSON files with no restart, so the icon profile below is fully installable from code.

Structs§

ProfileIconInstallReport
Outcome of install_profile_icon.

Enums§

TerminalIconCommand
Parsed /terminal-setup icon subcommand.

Constants§

PROFILE_GUID
Stable identity of the shipped iTerm2 profile so reinstalls overwrite instead of duplicating it.
PROFILE_ICON_FILENAME
Filename of the installed profile artwork under the data root.

Functions§

artwork_bytes
Artwork bytes for a concrete icon variant.
default_install_paths
Resolve default install locations: home directory and canonical data root.
dynamic_profile_json
Render the dynamic-profile JSON pointing at an absolute icon path.
ensure_profile_icon
Ensure the iTerm2 profile icon is installed, returning the install report when this call wrote files.
ensure_profile_icon_at
Testable core of ensure_profile_icon with explicit paths, environment flags, and resolved artwork preference (no process-environment reads, no global roots, no theme-global reads).
generate_config
Generate iTerm2 setup instructions (manual configuration required)
install_profile_icon
Install the VT Code iTerm2 profile icon (macOS only, idempotent).
installed_icon_path
Absolute destination of the installed icon under a data root.
parse_terminal_icon_command
Parse icon [variant] args (case- and whitespace-tolerant). Returns None for anything that is not an icon command, including unknown variants, so callers fall through to usage.
profile_icon_instructions
Guidance lines pointing at the automatic installer and the manual fallback.
resolve_artwork
Resolve an icon preference to concrete artwork against the active CLI theme.
resolve_artwork_with_theme
Resolve an icon preference to concrete artwork against a theme id. Dynamic (and Unknown) follow the theme’s own light/dark mode; explicit variants pin their art.
run_profile_icon_install
Run the non-interactive profile-icon install with progress output.
run_profile_icon_reset
Reset the current session’s iTerm2 profile to its original name.
run_terminal_icon_show
Report the Dynamic artwork resolution without writing files.
run_terminal_icon_switch
Install one icon variant immediately.