aboutsummaryrefslogtreecommitdiff
path: root/ui-terminal-curses.c
AgeCommit message (Collapse)AuthorFilesLines
2025-12-22move all standard library includes into util.hRandy Palamar1-1/+0
2025-01-04curses ui: fix default color detectionRandy Palamar1-20/+4
closes: #1209
2024-05-21remove some ui pointer chasingRandy Palamar1-2/+2
There only exists a single Ui so there is no need to force a pointer redirection for accessing it. The Ui member was moved down in vis-core.h to punt around an issue with the way lua checks for existing objects. It may show up again as I flatten more structs.
2024-05-21replace UiTerm with Ui & delete function pointersRandy Palamar1-27/+15
2024-03-25ui: refactor style handlingRandy Palamar1-4/+23
The old style handling had a lot edge cases where one of the colours or the attribute wouldn't get applied correctly. This commit adds a new style_set() method to the Ui which should be called instead of manually touching a cell's style. This also means that the Cell struct can be made opaque since all the handling is now done inside the ui-terminal files. With this it is now viable to combine the light and dark 16 colour themes into a single base-16 theme. This theme works very well with the Linux virtual console and will now be the default theme regardless of if the terminal supports 256 colours or not. This should address the common complaints about vis not respecting the users default terminal colours. fixes #1151: Theming is sometimes partially applied or ignored see #1103: terminal no longer has transparency/opacity see #1040: Transparent background and setting options by default
2023-12-02Add ansi escaping values and theming keyword for dimmed textHaz1-0/+1
This adds `[not]dim` to the set of accepted theme keywords
2023-08-01Prevent flickering in cursesIan Hixson1-1/+2
Reading from curs_refresh(3X) from curses, calling doupdate() repeatedly will cause 'several bursts of output to the screen'. wnoutrefresh() has the smarts to only copy the changed lines to the copied virtual screen, but doupdate() does not. There have been several bug reports related to flickering but all seems to be inconsistenly reproducible due to different terminal buffering behavior. See #1032, #327 Unfortunately, when I am using a slow display, I still notice flickering, so this commit changes the routines for opening new windows and splitting windows to wait until the last change is finished before calling doupdate().
2023-07-18Add fullscreen param to vis_pipe_collect() and Lua API vis:pipe()Jörg Bakker1-2/+7
This enables restoring the terminal from a fullscreen command like curses based program. Use cases are e.g. a file picker based on some external program like nnn (https://github.com/jarun/nnn).
2020-03-17color-column: Don't change fg/bg if not set explicitlyGennadiy Volkov1-0/+4
eg. if your long line is a comment with green fg, and you set your column color bg red while not specifying the fg, then the result is green fg on red bg. Prior to this change the result would be default fg on red bg, thus one char in the long line of green text would look odd/wrong. Of course if you do explicitly set the column color fg to default in your theme then the result will not be what you expect - ideally we need an UNSPECIFIED color type instead of relying on DEFAULT.
2018-02-18Support COLOR_PAIRS > SHRT_MAXMichael Forney1-2/+2
In ncurses 6.1, the TERMINAL structure was updated[0] to store data in `int` instead of `short`, and terminfo definitions for 256-color terminals were updated from `pairs#32767` to `pairs#0x10000`. However, since vis stores the value of COLOR_PAIRS in a short (ncurses internally stores it as an int), it is now overflowing into negative, breaking color support completely. The standard `init_pair` entry points still use `short` for their parameters, so just restrict the pairs to `SHRT_MAX` during allocation. [0] http://invisible-island.net/ncurses/announce-6.1.html#h4-new-library
2017-04-14vis: make certain operations interruptible with <C-c>Marc André Tanner1-1/+1
As currently implemented this will only work for operations which are individually fast, but repeated many times (e.g. `1000000itext<Escape>`).
2017-03-22ui: try to fix job control issues with certain shellsMarc André Tanner1-2/+7
Make sure that curses and libtermkey don't fight over the terminal state. Also send use SIGTSTP instead of SIGSTOP. Previously certain shells (e.g. csh, dash) would get stuck after the editor process was suspended for the second time. Not completely sure whether this is correct, but it seems to work in my limited tests.
2017-03-16ui: further cleanup display codeMarc André Tanner1-3/+3
2017-03-15ui: fix compiler warningMarc André Tanner1-1/+1
2017-03-14Restructure display codeMarc André Tanner1-0/+286
Use pull instead of push based model for display code. Previously view.c was calling into the ui frontend code, with the new scheme this switches around: the necessary data is fetched by the ui as necessary. The UI independent display code is moved out of view.c/ui-curses.c into vis.c. The cell styles are now directly embedded into the Cell struct. New UI styles are introduced for: - status bar (focused / non-focused) - info message - window separator - EOF symbol You will have to update your color themes. The terminal output code is further abstracted into a generic ui-terminal.c part which keeps track of the whole in-memory cell matrix and #includes ui-terminal-curses.c for the actual terminal output. This architecture currently assumes that there are no overlapping windows. It will also allow non-curses based terminal user interfaces.