diff --git a/doc/reference/interactive_console.rst b/doc/reference/interactive_console.rst index c2bfb73ac9..060dc22d19 100644 --- a/doc/reference/interactive_console.rst +++ b/doc/reference/interactive_console.rst @@ -12,14 +12,16 @@ or start :ref:`tarantoolctl ` with ``enter``. The interactive console is often called the Lua console to distinguish it from the administrative console, but in fact it can handle both Lua and SQL input. -The majority of examples in this manual show what users see with the -interactive console, including the prompt (which can be ``tarantool>``), -the instruction (which can be a Lua request or an SQL statement), -and the response (which can be a display in either YAML format or Lua format). +The majority of examples in this manual show what users see with the interactive console. +It includes: + +* ``tarantool>`` prompt +* instruction (a Lua request or an SQL statement) +* response (a display in either YAML or Lua format) .. code-block:: none - -- Typical interactive console example with Lua input and YAML output + -- Interactive console example with Lua input and YAML output tarantool> box.info().replication --- - 1: @@ -28,6 +30,11 @@ and the response (which can be a display in either YAML format or Lua format). lsn: 0 ... +.. _interactive_console_input_output: + +Interactive console input and output +------------------------------------ + The **input language** can be changed to SQL with ``\set language sql`` or changed to Lua (the default) with ``\set language lua``. @@ -35,12 +42,10 @@ The **delimiter** can be changed to any character with :samp:`\set delimiter `_. +Ordinarily, output from the console has `YAML format `_. That means that there is a line for document-start ``"---"``, and each item begins on a separate line starting with ``"- "``, and each sub-item in a nested structure is indented, @@ -54,7 +59,7 @@ So, when input is a Lua object description, output will equal input. YAML is good for readability. Lua is good for re-using results as requests. -A third format, MsgPack, is good for database storage. +The third format, MsgPack, is good for database storage. Currently the default output format is YAML but it may be Lua in a future version, and it may be Lua if the last :ref:`set_default_output ` @@ -120,3 +125,30 @@ call was ``console.set_default_output('lua')``. | :code:`...` - :code:`\x81 \xa3 \x6b \x65 \x79 \x01` + +.. _interactive_console-shortcuts: + +Keyboard shortcuts +------------------ + +Since :doc:`2.10.0 `. + +.. list-table:: + :widths: 25 75 + :header-rows: 1 + + * - Keyboard shortcut + - Effect + + * - ``CTRL+C`` + - Discard current input with the ``SIGINT`` signal in the console mode and + jump to a new line with a default prompt. + + * - ``CTRL+D`` + - Quit Tarantool interactive console. + +.. important:: + + Keep in mind that ``CTRL+C`` shortcut will shut Tarantool down if there is any currently running command + in the console. + The :ref:`SIGINT ` signal stops the instance running in a daemon mode. \ No newline at end of file diff --git a/doc/reference/reference_lua/console.rst b/doc/reference/reference_lua/console.rst index 7d8ecba9f2..5090c01cd1 100644 --- a/doc/reference/reference_lua/console.rst +++ b/doc/reference/reference_lua/console.rst @@ -215,7 +215,7 @@ Below is a list of all ``console`` functions. The output format can be changed within a session by executing :samp:`console.eval('\\\\set output {yaml}|{lua}')`; see the description of output format in the - :ref:`Interactive console ` section. + :ref:`Interactive console ` section. .. _console-eos: