summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-28use portable #!HEADmasterHelmut Grohne
Also default to python3 at this time. Reported-by: Robert Smallshire <rob@sixty-north.com>
2021-01-22Merge branch utf8 into masterHelmut Grohne
2021-01-22README.md: improve spelling and formattingHelmut Grohne
2021-01-22ignore bracketed pasted mode for nowHelmut Grohne
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.
2017-11-03implement "el" family properlyHelmut Grohne
el0 simply is el. el1 was implemented improperly and missed clearing the character under the cursor. el2 clears the whole line.
2017-11-03fix writing of utf8 chars in the last columnHelmut Grohne
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.
2017-01-16initial utf8 supportHelmut Grohne
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.
2017-01-10implement cursor position reporting (u7)Helmut Grohne
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.
2017-01-05improve corner cases related to resizing and mode switchingHelmut Grohne
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.
2016-12-19fix broken color handlingHelmut Grohne
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.
2016-12-15remove unused inch methodHelmut Grohne
The last user got removed with 458ccd1cdc60 ("fix rendering of alternate font for ncmpc").
2016-12-14fix SIGWINCH race condition during startupHelmut Grohne
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.
2016-12-12note known breakage with FreeBSD's cursesHelmut Grohne
On FreeBSD, curses.tigetstr('acsc') will return None unless Python is built against ncurses. Reported-By: Klaus Aehlig <aehlig@linta.de>
2016-12-12Make tcvt aware of the OSC sequencesKlaus Aehlig
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>
2016-12-10convert more branches into table lookupsHelmut Grohne
2016-12-10precompute lookup tablesHelmut Grohne
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.
2016-12-09fix adding characters at the end of the windowHelmut Grohne
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.
2016-12-09push the refresh logic into the Terminal classHelmut Grohne
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.
2016-12-09improve sub process handling: return child exit codeHelmut Grohne
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.
2016-12-09simplify Terminal start and stop using a context managerHelmut Grohne
2015-05-07fix manual page syntaxHelmut Grohne
Reported-By: Alfredo Canziani <alfredo.canziani@gmail.com>
2015-05-06Add an option to reverse the column orderKlaus Aehlig
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.
2015-02-09"\b" is also known as cub1Helmut Grohne
2013-06-22name two more terminal functions hpa and vpaHelmut Grohne
2013-06-22support attributes blink and invisHelmut Grohne
2013-06-22confused terminfo "ind" and "ht"Helmut Grohne
2013-06-20use terminfo capability namesHelmut Grohne
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.
2013-06-20use bytearraysHelmut Grohne
With bytearrays there is no need for hacks specific to the Python version such as byte_sequence.
2013-06-03add mappings for Fn keysHelmut Grohne
We don't gain anything here, because the emulated terminal does not support these keys. Should we switch the emulated terminal, this immediately helps.
2013-06-03clear screen on WINCHHelmut Grohne
Most applications do a full redraw on WINCH anyway. A shell doesn't and looks ugly.
2013-06-02fix WINCH handlingHelmut Grohne
* 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.
2013-06-02allow specifying the number of columnsHelmut Grohne
2013-06-02manpage: explain TCVT_DEVEL variableHelmut Grohne
2013-06-02support python3.3Helmut Grohne
2013-06-02support not crashing on unsupported sequencesHelmut Grohne
2013-06-02implement full alternate character setHelmut Grohne
We now get the characters from terminfo "acsc".
2013-06-02add new input mode feed_graphicsHelmut Grohne
Thereby we avoid accidentally treating graphics chars as regular chars, just because they were not yet implemented.
2013-06-01added more line drawing charactersHelmut Grohne
This makes aptitude work. Reported-By: Axel Beckert
2013-06-01added a READMEHelmut Grohne
2013-02-02swallow exceptions for unknown keysHelmut Grohne
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.
2013-02-02if argv is empty, start a $SHELLHelmut Grohne
2012-08-27support more than two columnsHelmut Grohne
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.
2012-04-15manpage: mention homepageHelmut Grohne
2012-04-15tcvt: code cleanup using propertiesHelmut Grohne
2012-04-15Makefile: don't fail to install twiceHelmut Grohne
2012-04-15print a reasonable error message when exec failsHelmut Grohne
2012-04-15added manual page tcvt.1Helmut Grohne
2011-10-04support outputting ACS_VLINEHelmut Grohne
This enables running tcvt inside tcvt resulting in four non-linearly ordered columns.
2011-09-30reduce screen.refresh()Helmut Grohne
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.
2011-09-14fixed enter key in vimHelmut Grohne