Age | Commit message (Collapse) | Author |
|
Also default to python3 at this time.
Reported-by: Robert Smallshire <rob@sixty-north.com>
|
|
|
|
When asked to enable or disable bracketed paste mode, we simply do
nothing for now. It's not great, but at least it makes the escape
sequence not clutter the view.
|
|
el0 simply is el.
el1 was implemented improperly and missed clearing the character under
the cursor.
el2 clears the whole line.
|
|
Using insch is nice, because it does not update the cursor position, but
it does not work with utf8 chars and outputs garbage instead.
The problem can be avoided by using addch, but it creates a new problem:
addch moves the cursor. For all but the very last character on the
screen that's fine, but adding the last character on the screen means
scrolling. Thus we follow the advice from
http://stackoverflow.com/a/41923640/1626632 and disable scrolling and
catching the exception.
|
|
Derive a UTF8Terminal class from Terminal that handles utf8 byte
sequences. It only works on Python 3.x, because feed_utf8 relies on
addch handling unicode str objects. The whole utf8 support is also
conditional to Python 3.x, because the locale module was not safe to use
in Python 2.x.
A terminal is considered utf8 if the LC_* or LANG variables indicate
that.
This branch still has known crashes. Writing non-ascii letter at the end
of a line or letting it scroll from one column to another causes
crashes. More problems may hide elsewhere.
|
|
This is used by a number of programs (including vim) to determine utf8
terminal capabilities.
The feed functions now return none or a bytes object. If a bytes object
is returned, it is sent back to the requesting program.
|
|
A few operations would previously fail unexpectedly:
* Running tcvt with many columns and a small terminal width would crash
instead of falling back to a simple screen.
* After switching the mode, column ordering would be lost.
* Switching the mode from simple to columns after resizing could result
in a crash.
Instead of collecting the screen options and passing them down
individually, the Terminal class now asks for a preconfigured screen
factory. This should eliminate future potential for similar mistakes.
|
|
When printing "\e[32mx\e[33mx\e[32mx\e[0m", the expected outcome is that
the first and third x share the same color. Prior to clearing A_COLOR,
the colors would be ORed yielding three different colors. This breaks
e.g. usage with mutt.
|
|
The last user got removed with 458ccd1cdc60 ("fix rendering of alternate
font for ncmpc").
|
|
Some programs (e.g. ncmpc) do not like receiving a terminal of unknown
size. Before we issue the resizepty method that would be the case. Since
there was no synchronisation between resizepty and execvp, a program
that starts quickly could run into this situation. Now we ensure that
resizepty is called before execvp using an extra pipe.
|
|
Ansi is vague about the meaning of the OSC sequences (i.e.,
the control sequences starting with <esc> ]): the interpretation is
up to the operating system. Nevertheless, some programs send these
sequences, most prominently the one to set the terminal title (OSC 0;).
So make tcvt aware of those sequences and pass them through.
Signed-off-by: Helmut Grohne <helmut@subdivi.de>
|
|
|
|
This improves performance of output-heavy workloads (e.g. the time it
takes to run find on a large tree) by 10% on CPython 2.7.
|
|
When the number of columns wasn't exactly 2 (the default), adding a
character at the end of the window could fail at scrolling thus yielding
corrupted output.
|
|
One advantage of doing so is that the main function becomes simpler.
Another advantage is that the Terminal class has better knowledge of
when refreshes are actually needed. It also means that one more refresh
call can be coalesced into the logic. The major downside is that it
requires annotating all screen operations.
|
|
Wrap the management of the sub process in a new class ForkPty. This
reduces the length and number of variables in the main function. Turn it
into a context manager to allow closing the masterfd and actually
waiting for the forked child (rather than reparenting it to init on
exit). This also allows propagating the exit code. Document the new exit
semantics.
|
|
|
|
In this way, for long dialoges (e.g., shell, ed) the focus
is in the lower left corner of the screen---the same as for
one-column terminals. Therefore, users used to that focus
can use this option to avoid changing reading habits.
|
|
|
|
|
|
|
|
|
|
Implement terminfo capabilities as do_CAP on the Terminal class. This is
a bit more generic and might allow to pull the parsing from terminfo at
some point.
|
|
With bytearrays there is no need for hacks specific to the Python
version such as byte_sequence.
|
|
We don't gain anything here, because the emulated terminal does not
support these keys. Should we switch the emulated terminal, this
immediately helps.
|
|
Most applications do a full redraw on WINCH anyway. A shell doesn't and
looks ugly.
|
|
* The switch to single column on WINCH was a bad idea.
* The new window would get old dimensions, because we would
reinitialize windows before curses noticed the new dimensions.
|
|
|
|
|
|
|
|
We now get the characters from terminfo "acsc".
|
|
Thereby we avoid accidentally treating graphics chars as regular chars,
just because they were not yet implemented.
|
|
This makes aptitude work.
Reported-By: Axel Beckert
|
|
Most often this feature comes at an inconvenient time. If a key turns
out dysfunctional, export TCVT_DEVEL=1 to see the value of the key.
|
|
|
|
The TwoColumn class is renamed to Columns since it now has a
configurable number of columns. Note that this support is not to the
command line yet.
|
|
|
|
|
|
This enables running tcvt inside tcvt resulting in four non-linearly
ordered columns.
|
|
Previously it would refresh after at most 1024 bytes of output. With a
slow terminal and much output this can be very annoying. So now we only
refresh when there is no more output or a tenth of a second has passed
since the last output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|