Command line editing

vsql supports the tecla library for convenient line editing and retrieval.

vsql supports the tecla library for convenient line editing and retrieval.

The command history is automatically saved when vsql exits and is reloaded when vsql starts up. Tab-completion is also supported, although the completion logic makes no claim to be a SQL parser. If for some reason you do not like the tab completion, you can turn it off by putting this in a file named .teclarc in your home directory:

bind ^I

Read the tecla documentation for further details.

Notes

The vsql implementation of the tecla library deviates from the tecla documentation as follows:

  • Recalling Previously Typed Lines

    Under pure tecla, all new lines are appended to a list of historical input lines maintained within the GetLine resource object. In vsql, only different, non-empty lines are appended to the list of historical input lines.

  • History Files

    tecla has no standard name for the history file. In vsql, the file name is called ~/.vsql_hist.

  • International Character Sets (Meta keys and locales)

    In vsql, 8-bit meta characters are no longer supported. Make sure that meta characters send an escape by setting their EightBitInput X resource to False. You can do this in one of the following ways:

    • Edit the ~/.Xdefaults file by adding the following line:

      XTerm*EightBitInput: False
      
    • Start an xterm with an -xrm '*EightBitInput: False' command-line argument.

  • Key Bindings:

  • 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.