Command line editing

vsql supports the tecla library for line editing and retrieval.

vsql supports the tecla library for line editing and retrieval. You can define a tecla configuration with the following files:

  • ~/.vsqlrc (user)

  • /opt/vertica/config/vsqlrc (global)

For details, see the tecla documentation.

Command history is automatically saved in ~/.vsql_history when vsql exits and is reloaded when vsql starts.

Disabling tab completion

To disable tab completion, add the following to .vsqlrc:

\bind ^I

Key bindings

Key bindings are read from a global configuration at /opt/vertica/config/vsqlrc, if present. To override key bindings, add definitions to ~/.vsqlrc.

Key bindings must be prefixed with a backslash (\). For example, the following definition binds the "backward-word" action to Ctrl+B:

\bind ^B backward-word

The following key bindings are specific to vsql:

  • Insert switches between insert mode (the default) and overwrite mode.

  • Delete deletes the character to the right of the cursor.

  • Home moves the cursor to the front of the line.

  • End moves the cursor to the end of the line.

  • ^R Performs a history backwards search.

Implementation differences

The vsql implementation of the tecla library deviates from the tecla documentation in the following ways:

  • Unlike the standard tecla library, which saves all executed lines in the command history, vsql only saves unique non-empty lines.

  • vsql standardizes the name and location of the history file (~/.vsql_history).

  • vsql does not support 8-bit meta characters. This can affect international character sets, meta keys, and locales. You can verify that a meta character sends an escape by setting the EightBitInput X resource to False. You can do this in the following ways:

    • Add the following to ~/.Xdefaults:

      XTerm*EightBitInput: False
      
    • Start an xterm session with the -xrm '*EightBitInput: False'.