An integrated terminal plugin for QGIS, similar to VS Code's integrated terminal. Provides a dockable terminal panel with full shell access, ANSI color support, and cross-platform compatibility.
- Integrated Terminal: A dockable terminal panel that works like VS Code's terminal
- True Interactive Shell: Full pty-based shell with history, tab completion, and signal handling
- ANSI Color Support: Colored output for commands like
ls --color,git, and more - Cross-Platform: Works on Linux, macOS, and Windows
- Multiple Shells: Auto-detects available shells (bash, zsh, sh, PowerShell, cmd)
- Configurable: Font, color scheme, shell path, and scrollback buffer settings
- QGIS Integration: Defaults to the current QGIS project directory
qgis-terminal-plugin/
├── qgis_terminal/
│ ├── __init__.py # Plugin entry point
│ ├── qgis_terminal.py # Main plugin class
│ ├── metadata.txt # Plugin metadata for QGIS
│ ├── deps_manager.py # Dependency management
│ ├── uv_manager.py # uv package manager support
│ ├── LICENSE # Plugin license
│ ├── terminal/ # Terminal implementation
│ │ ├── __init__.py
│ │ ├── ansi_parser.py # ANSI escape sequence parser
│ │ ├── shell_process.py # Cross-platform shell process manager
│ │ ├── terminal_view.py # Terminal display widget
│ │ ├── terminal_widget.py # Container with toolbar
│ │ └── terminal_dock.py # QDockWidget wrapper
│ ├── dialogs/
│ │ ├── __init__.py
│ │ ├── settings_dock.py # Settings panel
│ │ └── update_checker.py # Update checker dialog
│ └── icons/
│ ├── terminal.svg # Terminal icon
│ ├── settings.svg # Settings icon
│ └── about.svg # About icon
├── package_plugin.py # Python packaging script
├── package_plugin.sh # Bash packaging script
├── install.py # Python installation script
├── install.sh # Bash installation script
├── README.md # This file
└── LICENSE # Repository license
- QGIS 3.28 or later
- Python 3.10+
- Open QGIS
- Go to Plugins -> Manage and Install Plugins...
- Go to the Settings tab
- Click Add... under "Plugin Repositories"
- Give a name for the repository, e.g., "OpenGeos"
- Enter the URL of the repository: https://qgis.gishub.org/plugins.xml
- Click OK
- Go to the All tab
- Search for "QGIS Terminal"
- Select the plugin and click Install Plugin
# Install
python install.py
# Or with bash
./install.sh
# Remove
python install.py --removeCopy the qgis_terminal folder to your QGIS plugins directory:
- Linux:
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ - macOS:
~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ - Windows:
%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\
- Enable the plugin in QGIS: Plugins -> Manage and Install Plugins... -> Enable "QGIS Terminal"
- Click the Terminal button in the toolbar, or go to QGIS Terminal -> Terminal
- The terminal panel appears at the bottom of the QGIS window
- Type commands and interact with the shell as you would in any terminal
| Shortcut | Action |
|---|---|
Ctrl+C |
Copy (if text selected) or send interrupt signal |
Ctrl+V |
Paste from clipboard |
Ctrl+L |
Clear screen |
Ctrl+D |
Send EOF |
Ctrl+A |
Select all |
Up/Down |
Navigate command history |
Tab |
Shell tab completion |
Page Up/Down |
Scroll terminal output |
- Shell Selector: Choose between available shells (bash, zsh, PowerShell, etc.)
- Clear: Clear the terminal output
- Restart: Kill the current shell and start a new one
The terminal is built from four main components:
-
AnsiParser (
ansi_parser.py): Parses ANSI/VT100 escape sequences and converts them to Qt text formatting (colors, bold, underline, etc.) -
ShellProcess (
shell_process.py): Cross-platform shell process manager- Unix: Uses
pty.openpty()for true terminal emulation withQSocketNotifierfor non-blocking I/O - Windows: Uses
subprocess.Popenwith pipe-based I/O andQTimerpolling
- Unix: Uses
-
TerminalView (
terminal_view.py): AQPlainTextEditsubclass that displays terminal output and forwards keyboard input to the shell -
TerminalWidget (
terminal_widget.py): Container with toolbar and terminal view, manages the shell lifecycle
- pty-based terminal (not QProcess): Provides true terminal emulation where shell history, tab completion, and interactive programs work natively
- Read-only QPlainTextEdit + key forwarding: The pty handles echo and line editing; no complex input buffer tracking needed
- No external dependencies: Uses only Python stdlib and PyQt5 from QGIS
- QPlainTextEdit over QTextEdit: Better performance for large output, supports scrollback limiting
# Package for QGIS plugin repository
python package_plugin.py
# Custom output path
python package_plugin.py --output /path/to/output.zipThis project is released under the MIT License. See LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request.