On this page
Keyboard shortcuts
Every key BroadSQL responds to, in the three places you type: the interactive console (the WORLD> prompt), the BroadSQL Editor (EDIT) and the configuration window (CONFIG). Type HELP SHORTCUTS; at the prompt to see the console keys without leaving BroadSQL.
A console runs inside a terminal, and a terminal decides which codes reach BroadSQL. A few keys therefore work in some terminals and not in others: they are listed apart, and Support by terminal says what to use instead.
Interactive console
Type HELP SHORTCUTS; inside BroadSQL to display these shortcuts in the console. It works with or without a database connection.
| Key | Effect |
|---|---|
| Enter | Submits the line. A command runs once BroadSQL has read its closing ; (see Entering commands). |
| Tab | Completes the word being typed (see TAB completion). With several candidates, opens a menu: Tab moves to the next candidate, Shift+Tab to the previous one. At the start of a line it inserts a TAB, for indentation. |
| Esc | Cancels everything you are typing and leaves an empty prompt: the whole line wherever the cursor is, and also the earlier lines of a statement you have not yet ended with ;. Nothing runs and nothing is added to history. Also works while the completion menu is open, after recalling a command with Up, and during a Ctrl+R search. |
| Up / Down | Previous / next command in history. Editing a recalled command never changes the stored one. |
| Ctrl+R | Searches history backward: type part of an earlier command to show the most recent match; Ctrl+R again finds an older one. Enter runs the match, End keeps it on the line for editing, Esc cancels. |
| Left / Right | Moves the cursor one character. |
| Home / End, Ctrl+A / Ctrl+E | Moves to the beginning / end of the line. |
| Backspace / Delete | Deletes the character before / at the cursor. |
| Ctrl+U | Deletes from the cursor back to the beginning of the line. |
| Ctrl+K | Deletes from the cursor to the end of the line. |
| Ctrl+W, Alt+Backspace | Deletes the word before the cursor. |
| Ctrl+L | Clears the screen and keeps what you have typed. |
| Ctrl+C | While a command is running: stops it and keeps the connection open (see Ctrl+C during a command). While typing: abandons the current line only; earlier lines of an unfinished statement stay pending (Esc abandons them too). Ctrl+C is never a way to end BroadSQL: use exit. |
| Ctrl+D | Deletes the character at the cursor. On an empty line, ends BroadSQL the same way exit does. |
These depend on what your terminal sends, so they are not guaranteed:
- Ctrl+Left / Ctrl+Right move to the previous / next word in the Windows console and in most terminals. With Shift or Alt added (Ctrl+Shift+Left, Alt+Right, and so on) they move by word too: a terminal prompt has no text selection, so Shift selects nothing. Shift+Left / Shift+Right move one character, and Up, Down, Home and End do with any modifier what they do alone. None of these keys clears the line or types characters.
- Ctrl+Backspace deletes the previous word in terminals that send it differently from Backspace: most Linux and macOS terminals. The Windows console sends the same code as Backspace, so there it deletes one character: use Ctrl+W or Alt+Backspace.
- Ctrl+Delete deletes the next word in terminals that send a distinct code for it. The Windows console sends the same code as Delete, so there it deletes one character: use Alt+D.
- Alt+B / Alt+F move back / forward one word, and Alt+D deletes the next word. Other Alt+letter editing commands may work too, depending on the terminal. A terminal sends Alt+key as Esc followed by the key, so pressing Esc and another key less than about a tenth of a second apart can be read as Alt+that key.
What a word is
Ctrl+W, Alt+Backspace, Ctrl+Backspace, Alt+D and Ctrl+Delete delete words the same way. A word ends at a space, a comma or a quote; dots, underscores and parentheses belong to it. With the cursor after SALES.ORDERS, Ctrl+W deletes SALES.ORDERS at once; after A, B it deletes B and keeps A, . Spaces just before the cursor go with the word before them. The deleted text can be put back with Ctrl+Y.
Statements on several lines
- Enter on a line without a closing
;keeps the statement open; the next line continues it. - Esc abandons the whole statement, every line of it; Ctrl+C abandons only the line being typed.
- Every editing key above works on the line being typed. A line already submitted cannot be edited again: press Esc and type the statement again, or recall it with Up.
Completion menu
| Key | Effect |
|---|---|
| Tab / Shift+Tab | Next / previous candidate. |
| Arrow keys | Move between candidates. |
| Enter | Keeps the highlighted candidate. |
| Esc | Closes the menu and cancels the input, as Esc does at the prompt. |
| Any other key | Keeps the highlighted candidate and types the key. |
Support by terminal
What reaches BroadSQL for the keys that differ. "Word" means the key works on words as described above; the last column gives the keys that work everywhere.
| Terminal | Ctrl+Backspace | Ctrl+Delete | Ctrl+Left / Right, Ctrl+Shift+Left / Right | Use instead |
|---|---|---|---|---|
| Windows console: Command Prompt, PowerShell, Windows Terminal | One character | One character | Word | Ctrl+W or Alt+Backspace; Alt+D |
| Linux and macOS terminals (GNOME Terminal, Konsole, xterm, macOS Terminal, iTerm2) | Word, when Backspace sends DEL (the usual setting) | Word | Word | Ctrl+W, Alt+D |
| Other terminals (for example Git Bash, or a remote session) | Depends on the terminal | Depends on the terminal | Usually word | Ctrl+W, Alt+Backspace, Alt+D |
Notes:
- In the Windows console, BroadSQL receives Ctrl+Backspace and Ctrl+Delete exactly as Backspace and Delete: no setting of BroadSQL can tell them apart.
- On a Linux or macOS terminal, Ctrl+Backspace and Ctrl+H send the same code, so Ctrl+H also deletes the previous word there. When Backspace itself sends that code (an unusual setting, shown by
stty -aaserase = ^H), BroadSQL keeps it as Backspace and Ctrl+Backspace deletes one character. - Some systems use Ctrl+Left / Ctrl+Right for themselves (switching desktops on macOS, for example): the key then never reaches BroadSQL. Alt+B / Alt+F do the same.
BroadSQL Editor
| Key | Effect |
|---|---|
| Ctrl+N | New Script |
| Ctrl+S / Ctrl+Shift+S | Save / Save All |
| F5 | Run the active Script |
| Ctrl+W | Close the tab |
| Ctrl+Z / Ctrl+Y | Undo / Redo |
| Ctrl+F / Ctrl+H | Find / Find and Replace (Esc closes the dialog) |
| Ctrl+Left / Ctrl+Right | Previous / next word |
| Shift+arrows, Ctrl+Shift+Left / Right | Select by character / by word |
| Ctrl+Backspace / Ctrl+Delete | Delete the previous / next word (with a selection, Ctrl+Delete deletes the selection) |
| Ctrl+D | Delete the line |
| Ctrl+A, Ctrl+C, Ctrl+X, Ctrl+V | Select all, copy, cut, paste |
The Editor is a window of its own, so every key above works the same whatever the terminal BroadSQL runs in. More on the Editor: BroadSQL Editor.
Configuration window (CONFIG)
| Key | Effect |
|---|---|
| Ctrl+N | New connection, Database Group or Environment |
| Ctrl+S | Save the form of the selected tab |
| Ctrl+D | Duplicate the selected connection |
| Ctrl+Z / Ctrl+Y | Undo / Redo the typing in the text field you are in; not in password fields |
| F4 | Close the window (asks first about changes not saved) |
Edit > Revert changes puts back the values last loaded or saved; it has no shortcut, so that Ctrl+Z stays the undo of the field you are typing in. Delete permanently has no shortcut either: it is always a menu or button click, followed by a confirmation. See CONFIG.
Related
Found something wrong or unclear on this page? Tell us, with the page address.