Notes for future coding agents working on Gnome Connection Manager (GCM).
- GCM is a GTK 3 + VTE based SSH/telnet tabbed terminal manager written in Python (
gnome_connection_manager.py). - UI layout and signal wiring live in
gnome-connection-manager.glade; widgets are loaded throughGtk.Builder(GladeComponenthelper insideapp.py). - Terminal behavior is customized through
style.css,urlregex.py(link detection patterns), and helpers such asssh.expectand the externalpyaeslibrary.
gnome_connection_manager.py– core application logic: configuration (classconf), window/controller classes (Wmain,Whost,Wconfig, etc.),Host/HostUtilsmodels, encryption helpers, and VTE management.gnome-connection-manager.glade– GTK Builder UI definition. Keep widget names/signals aligned with handler names ingnome_connection_manager.py.GladeComponent(ingnome_connection_manager/app.py) – lightweight builder wrapper that loads the glade file, binds translations, and dispatches signal callbacks.pyaes– PyPI dependency used for AES-256 encryption; installed via the Python package manager.ssh.expect– Expect script that wraps/usr/bin/sshand/usr/bin/telnetto feed stored credentials, propagate terminal resize events, and hand control back to the VTE widget.urlregex.py– prebuilt PCRE2-compatible regex strings for hyperlink detection inside terminals.lang/– gettext.posources and compiled.mofiles under<lang>/LC_MESSAGES/gcm-lang.mo.style.css,icon.png,donate.gif,.desktop,postinst, and packaging plumbing (Makefile).
- Runtime: Python 3, PyGObject (
python3-gi), GTK 3,gir1.2-vte-2.91(orpython3-gobjecton Fedora), andexpect. VTE terminals expect a usable$SHELLand systemssh/telnetbinaries. - Build/packaging: gettext
msgfmt, Ruby +fpm(for.deband.rpm), gzip, desktop-file utilities (xdg-desktop-menuinvoked inpostinst). - Paths assume a desktop install (
/usr/share/gnome-connection-manager). When running from the repo use./gnome_connection_manager.pyso relative paths resolve for assets, CSS, expect scripts, and translations. - Preferred tooling: use the recipes in
justfile(just run,just check,just test, etc.) for day-to-day work. When you need a command without a recipe, run it throughuv run …so the repo’s environment is honored.
- Launch locally with
just run(preferred) oruv run python -m gnome_connection_managerafter ensuringpython3-gi,Vte, andexpectare installed. - GUI/manual tests: open the app, add/edit hosts, connect via SSH/telnet, split notebooks, test clipboard shortcuts, run cluster commands, and verify preferences persist in
~/.gcm/gcm.conf. - Override language as needed via
LANG=en_US.UTF-8 ./gnome_connection_manager.py(mirrors README instructions). - When touching terminal behavior confirm
ssh.expectstill runs (chmod +xif needed) and that resizing, password prompts, and keyboard shortcuts behave.
- User data lives in
~/.gcm/:gcm.conf(INI) holds options, window state, shortcuts, and serializedHostentries (HostUtils.load_host_from_ini/HostUtils.save_host_to_ini).
.gcm.keystores the per-user passphrase used bypyaes.load_encryption_key+initialise_encyption_keymanage it; respect permissions (0600).- Configuration defaults reside in the
confclass (gnome_connection_manager.py:246) and must be updated alongsideloadConfigandwriteConfigwhen introducing new settings. - Host attributes include group/name/description, connection info, tunnels, terminal overrides, clipboard/logging flags, colors, command sequences, and SSH options. Keep
Host.clone,HostUtils.save_host_to_ini, dialogs inWhost, and import/export features in sync. - Password handling flows through
encrypt/decrypt(PyPIpyaeswith fallback to legacy XOR). Any changes must maintain backward compatibility by honoringconf.VERSION. - Logging goes to stderr via Python's logging module. Set
GCM_LOG_LEVEL(e.g.,DEBUG,INFO) to adjust verbosity during troubleshooting.
- Modify UI in
gnome-connection-manager.gladeand ensure widget IDs still match the handler names (e.g.,on_btnConnect_clicked).GladeComponentauto-normalizes names, so keep consistent prefixes if you rely onself.widget_name. - CSS tweaks go into
style.css(loaded byGtk.CssProvider). Test on GTK 3 to verify selectors. - Translations live in
.pofiles; compile MO files withmake translate(invokesmsgfmt). Add new locales by copying an existing.po, updating headers, and adding a matching directory hierarchy (e.g.,lang/es/LC_MESSAGES/gcm-lang.mo). - Visible strings in Python/Glade should be wrapped with
_()so gettext picks them up.
uv run make,uv run make deb, anduv run make rpmrely onfpmpackaging: build translations, stage files under/usr/share/gnome-connection-manager, and produce artifacts in the repo root.postinstregisters the desktop entry throughxdg-desktop-menu; update it if install paths change.Makefile check/make style-strip-trailing-whitespaceenforce newline cleanliness; run these before contributing patches meant for release.- Desktop integration metadata is defined in
gnome-connection-manager.desktop(Exec path, categories, icon). Update both the desktop file and packaging copy steps together.
- Codebase predates modern formatting: lots of globals, manual signal hookups, custom dialog helpers, and Python 2 idioms (
xrange, old-style prints). Match the existing style and avoid sweeping refactors or auto-formatters unless explicitly tasked. - Favor the provided helpers (
msgbox,inputbox,vte_feed,HostUtils, etc.) instead of duplicating behavior, since they already handle edge cases (VTE versions, encoding, config compatibility). - Tests are manual. When changing behavior, document the manual test surface (e.g., “open local console, run cluster command, export hosts”).
- When adding UI controls or config fields, keep these in sync: defaults (
conf), glade widgets, load/write logic, export/import, command-line interactions, and translations/tooltips. - Expect script assumes
/usr/bin/{ssh,telnet}; if touching authentication flows, check the expect regexes (ssh.expect) and resize trap. - Use
rg/msgfmt/make checkfor quick validation; repository intentionally keeps ASCII assets under version control—avoid re-encoding binary files unless needed.
- Understand which component you're touching (core app, expect script, packaging, translations) and review its neighbor files before editing.
- Update configs, dialogs, translations, and docs together when introducing user-facing options.
- Run the app (or at minimum sanity-check
python3 gnome_connection_manager.py --help) before/after code changes; describe any unverified areas in your final summary. - Rebuild translations (
make translate) if.pofiles change, and mention this in your response. - For packaging changes, run the relevant
maketarget when possible and summarize the outcome (artifacts, issues). - Keep
~/.gcmbackups handy when testing to avoid clobbering user data; include migration notes if you modify file formats.