diff options
author | James Johnson <d0c.s4vage@gmail.com> | 2019-12-14 21:36:56 -0800 |
---|---|---|
committer | Maxim Ivanov <ulidtko@gmail.com> | 2019-12-15 19:13:07 +0200 |
commit | d9e218085e12550a164f850fd7768e6180c1e5c3 (patch) | |
tree | 8a80a2546a2d3b2d0fefd6839e4c5d4244a0c39e | |
parent | 8626872740ec2912f872b38160daa8e740a2a2ff (diff) | |
download | urwid-d9e218085e12550a164f850fd7768e6180c1e5c3.tar.gz |
Updated documentation on Terminal
-rw-r--r-- | urwid/vterm.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/urwid/vterm.py b/urwid/vterm.py index 05d0c83..c7ecd84 100644 --- a/urwid/vterm.py +++ b/urwid/vterm.py @@ -1328,29 +1328,36 @@ class Terminal(Widget): def __init__(self, command, env=None, main_loop=None, escape_sequence=None, encoding='ascii'): """ - A terminal emulator within a widget. + A terminal emulator within a widget. BLAH - 'command' is the command to execute inside the terminal, provided as a + ``command`` is the command to execute inside the terminal, provided as a list of the command followed by its arguments. If 'command' is None, the command is the current user's shell. You can also provide a callable instead of a command, which will be executed in the subprocess. - 'env' can be used to pass custom environment variables. If omitted, + ``env`` can be used to pass custom environment variables. If omitted, os.environ is used. - 'main_loop' should be provided, because the canvas state machine needs + ``main_loop`` should be provided, because the canvas state machine needs to act on input from the PTY master device. This object must have watch_file and remove_watch_file methods. - 'escape_sequence' is the urwid key symbol which should be used to break - out of the terminal widget. If it's not specified, "ctrl a" is used. + ``escape_sequence`` is the urwid key symbol which should be used to break + out of the terminal widget. If it's not specified, ``ctrl a`` is used. - 'encoding' specifies the encoding that is being used when local + ``encoding`` specifies the encoding that is being used when local keypresses in Unicode are encoded into raw bytes. The default encoding - is 'ascii' for backwards compatibility with urwid versions <= 2.0.1. - Set this to the encoding of your terminal (typically 'utf8') if you + is ``ascii`` for backwards compatibility with urwid versions <= 2.0.1. + Set this to the encoding of your terminal (typically ``utf8``) if you want to be able to transmit non-ASCII characters to the spawned process. Applies to Python 3.x only. + + .. note:: + + If you notice your Terminal instance is not printing unicode glyphs + correctly, make sure the global encoding for urwid is set to + ``utf8`` with ``urwid.set_encoding("utf8")``. See + :ref:`text-encodings` for more details. """ self.__super.__init__() |