Settings, colours and keys

The Settings dialog, colour schemes, keymap.toml and settings.toml.

The Settings dialog

The Settings dialog
Settings → Settings…

OK applies the values and writes settings.toml. Settings that need a note:

SettingDefaultNote
Colour schemeClassicPreviewed while you move through the list. See Colour schemes.
ASCII frames (+ - |)offSee below.
Connect timeout (s)10connect_timeout of every session pgtc opens (1 – 3,600).
Show system objects in the treeoffAdds the pg_toast and temporary schemas, template databases, the pg_* roles and extension members. Also applies to Find object.
Rows per batch1000Rows read before a result is paused (1 – 1,000,000). See Large results.
Cancel wait (s)5Time after a cancel request before pgtc offers to close the session (1 – 3,600). See Cancelling.
Auto commit / Auto rollback on erroron / offInitial state of new query tabs only; open tabs keep theirs (Query menu).
Ask to save query tabs when closingonOff: unsaved text is discarded without a question — also on quit and disconnect.
System clipboardonThe clipboard of the host pgtc runs on.
OSC 52 clipboard (terminal, SSH)onCopy also goes to the terminal as an OSC 52 sequence — what makes copy work over SSH (Copy and paste). Turn off if the terminal prints garbage on copy.

ASCII frames

pgtc with ASCII frames
ASCII frames on.

For terminals or fonts without line-drawing characters: all frames and lines are drawn with + - = |. If the screen is too garbled to reach the dialog, set ascii_frames = true under [ui] in settings.toml.

Colour schemes

SchemeNeeds
Classic (default), Dark, LightThe 16 basic colours; their exact shades are the terminal's.
Terminal defaultThe terminal's own background, text colour and 16 colours.
Tokyo Night, DraculaTrue colour (24-bit). Wrong or blocky colours: the terminal, the SSH client or screen / tmux does not pass it.
Dark
Dark
Light
Light
Terminal default
Terminal default
Tokyo Night
Tokyo Night
Dracula
Dracula

Your own colour scheme

A .toml file in the themes folder appears in the list after a restart:

PlatformThemes folder
Linux~/.local/share/pgtc/themes
macOS~/Library/Application Support/pgtc/themes
Windows%APPDATA%\pgtc\themes

A scheme lists only what it overrides; the rest is inherited from Classic. The built-in schemes are in the themes folder of the source code.

name = "Green editor"

[editor]
text        = "lightgreen on black"
keyword     = "white on black bold"
string      = "lightyellow on black"
number      = "lightcyan on black"
comment     = "darkgray on black italic"
selection   = "black on lightgreen"
line_number = "green on black"

An entry is "foreground on background", optionally followed by bold, dim, italic, underlined, reversed.

ColourWrite
Normalblack red green yellow (or brown) blue magenta cyan lightgray
Brightdarkgray lightred lightgreen lightyellow lightblue lightmagenta lightcyan white
The terminal's owndefault
True colour#rrggbb
SectionEntryColours
[core]normal, borderThe object tree and window background; frames and lines.
title, title_focusedThe tree's title, without / with the focus.
selectedThe cursor row of the tree and of lists, with the focus.
selected_unfocusedThe cursor row while the focus is elsewhere.
hintQuiet texts such as loading….
[menu]normal, hotkeyMenu bar, pull-down and context menus, the autocomplete list; the highlighted letters.
selected, selected_hotkeyThe highlighted item.
disabledItems that cannot run now.
[dialog]normal, title, hotkeyDialog text, title, highlighted letters.
focus, focus_hotkeyThe focused button or list row.
input, input_focusInput fields, without / with the focus.
disabled, shadowUnusable parts; the dialog's shadow.
[error]normal, titleError messages.
[tabs]bar, inactiveThe tab strip; tabs not shown; the file bar.
active, active_unfocusedThe shown tab, with / without the focus.
[status]normal, windowA tab's status row; the bottom line of the screen.
[editor]text, line_numberPlain text; line numbers.
keyword, string, number, comment, quoted_ident, operatorSQL tokens.
selectionSelected text.
[grid]header, row_numberColumn names; row numbers.
cursor, nullThe cell cursor; [null].
[messages]error, notice, infoThe lines of Messages.
[dashboard]graphThe graphs.
blocked, blocking, idle_in_transaction, taggedSession rows.
slow, very_slowDurations from 1 s / from 10 s; warning values of the summary.

Changing keys: keymap.toml

PlatformFile
Linux~/.config/pgtc/keymap.toml
macOS~/Library/Application Support/pgtc/keymap.toml
Windows%APPDATA%\pgtc\keymap.toml

pgtc does not create the file and reads it once, at start. The actual path is at the end of Help → Keyboard shortcuts.

# keymap.toml — only what differs from the built-in keys

[editor]
execute = ["F5", "Ctrl+Enter"]     # two keys for one command
commit = "Alt+C"                   # a command that has no built-in key
rollback = "Alt+R"

[results]
export_result = "Alt+X"

[tree]
quick_search = "Alt+S"             # only this key; Ctrl+S no longer searches
drop_object = []                   # no key at all
SectionFocus in…
[global]any part, unless that part binds the key itself.
[tree]the object tree.
[editor]the SQL editor, an object definition, a statement pane.
[results]the result grid and Messages.
[dashboard], [profiler], [db_stats]the list of that tab.
[dialog]dialogs, menus and lists.
Key namesWrite
ModifiersCtrl, Alt, Shift, joined with +: Ctrl+Shift+Z. Case does not matter.
Function keysF1 … F24
Named keysEsc Tab Enter Space Backspace Delete Insert Home End PageUp (PgUp) PageDown (PgDn) Up Down Left Right
CharactersThe character itself: Ctrl+E, Alt+1, Alt+/

The settings file

settings.toml, next to keymap.toml, holds the dialog's values and the saved connections. With two pgtc open, each writes the whole file; a connection the other one saved meanwhile is taken over, not lost. For everything else the last save counts.

Settings that exist only in the file:

Section and keyDefaultMeaning
[editor] tab_width4Display width of a tab character.
[editor] line_numberstrue
[ui] tree_widtha third of the windowColumns; written when the tree's border is dragged.
[export] format, csv_separator, csv_bomcsv, comma, falseThe last choices of the export dialog.
[ui]
color_scheme = "Dracula"
show_system_objects = false
ascii_frames = false

[query]
batch_rows = 1000
auto_commit = true
auto_rollback = false
cancel_wait_secs = 5
ask_save = true

[clipboard]
system = true
osc52 = true

[connection]
connect_timeout_secs = 10

[editor]
tab_width = 2
line_numbers = true

[ai]
enabled = true
protocol = "anthropic"
base_url = "https://api.anthropic.com"
model = "claude-sonnet-5-5"
effort = "default"

[[servers]]
name = "production"
host = "db.example.com"
port = 5432
database = "adventureworks"
username = "app"
ssl_mode = "verify-full"
ssl_root_cert = "/etc/ssl/our-ca.pem"
ai_not_allowed = true
ItemWhat it does
AI…Provider, model and API key of the AI assistant.
Run setupAs pgtc --setup; reports each step.
Install templatesAs pgtc --install-templates: copies the built-in developer templates into the templates folder; asks before overwriting.
Show templates folderShows the folder's path.