summaryrefslogtreecommitdiff
path: root/src/terminal_ui.hh
AgeCommit message (Collapse)Author
2025-07-08Replace std::unique_ptr with a custom implementationMaxime Coste
<memory> is a costly header we can avoid by just implementing UniquePtr ourselves, which is a pretty straightforward in modern C++, this saves around 10% of the compilation time here.
2025-06-28fix: simplify variable by removing terminal_ partYukai Huang
2025-06-28Revert "chore: remove terminal option"Yukai Huang
This reverts commit 549a5d2c223d422390795741537b150b492a3935.
2025-06-27chore: remove terminal optionYukai Huang
2025-06-27fix: prevent cursor rendering conflicts by simplifying cursor positioning logicYukai Huang
2025-06-24feat(terminal): add option for native terminal cursor renderingYukai Huang
2024-09-08Add terminal_title terminal ui_option to control the titleMaxime Coste
Use a separate option from terminal_set_title for simplicity. Fixes #2217 Closes #4265
2024-08-16include headers cleanupAdriĆ  Arrufat
2023-11-24Skip output synchronization query when explicitly disabledChris Webb
Some terminals misbehave when queried for output synchronization support, such as Windows Terminal as reported in https://github.com/mawww/kakoune/issues/5032 The relatively long response from a terminal which does support output-sync is also prone to getting torn over a slow link such as a serial console, causing stray input to the editor. In ui_options, the terminal_synchronized option controls the use of this feature, but unfortunately the query is unconditionally sent at startup even when this is set false. Skip the query at startup when terminal_synchronized is explicitly false. We query at most once per terminal in set_ui_options so the behaviour is correct both when kakoune is started with terminal_synchronized unset and when it is started with terminal_synchronized set false but this is later unset.
2023-03-11Implement bracketed pasteJohannes Altmanninger
Text pasted into Kakoune's normal mode is interpreted as command sequence, which is probably never what the user wants. Text pasted during insert mode will be inserted fine but may trigger auto-indentation hooks which is likely not what users want. Bracketed paste is pair of escape codes sent by terminals that allow applications to distinguish between pasted text and typed text. Let's use this feature to always insert pasted text verbatim, skipping keymap lookup and the InsertChar hook. In future, we could add a dedicated Paste hook. We need to make a decision on whether to paste before or after the selection. I chose "before" because that's what I'm used to. TerminalUI::set_on_key has EventManager::instance().force_signal(0); I'm not sure if we want the same for TerminalUI::set_on_paste? I assume it doesn't matter because they are always called in tandem. Closes #2465
2023-02-15Add option to set maximum info box widthAmeer Ghani
Some plugins (*cough* kak-lsp) and help texts tend to have immensely long content in a single line. This generates info boxes that span the entire terminal width. This is made especially worse on widescreen monitors or at small text size. This grants user control over how wide these boxes are. I deliberately avoid pushing this change to `kak-lsp` because it's not the only plugin that this could help--see the `hook` help text for an example of this problem in vanilla Kakoune. I would also suggest that since this is a rendering concern, it be handled by the terminal rendering logic.
2021-10-23Use DECRQM/DECRPM to detect support for synchronized outputMaxime Coste
Enable it if supported by default, let the user override it with the existing terminal_synchronized ui option. This should finalize work discussed on #4317
2021-09-02Remove terminal_wheel_up/down_button UI optionMaxime Coste
It seems nobody uses it, and it is not plugged through anyway. Closes #2642
2021-08-05Reduce memory usage and allocations in terminal output codeMaxime Coste
Store data in unique_ptr instead of vectors as we have fixed sizes Do not allocate new hashes, recompute them on-demand
2021-08-01Use a BufferedWriter to output in the terminal ui instead of stdioMaxime Coste
Clearer control of buffering and flushing
2021-07-12Add 'terminal_synchronized' ui_option to opt-in synchronized outputMaxime Coste
Synchronized output does not work well with various terminals (including the linux console). It should also be unnecessary when not going through a slow link. This will eventually be removed if it is not proven to be useful to some users.
2021-07-12Reduce amount of SGR escapes emitted by tracking the active faceMaxime Coste
2021-07-12Remove the concept of cursor in TerminalUI::WindowMaxime Coste
2021-07-12Only redraw updated linesMaxime Coste
2021-07-12Blit all window together before outputing them to the ttyMaxime Coste
This should reduce flicker, by avoiding transient states where info/menu windows are not displayed, and paves the way for proper diffing of the screen.
2021-07-12Rename NCursesUI to TerminalUIMaxime Coste