475 Commits

Author SHA1 Message Date
Kovid Goyal
a653233050
Fix #4117 2021-10-14 14:31:11 +05:30
Kovid Goyal
c3f4e734f1
API to set screen window number 2021-10-11 18:00:18 +05:30
Kovid Goyal
d6a43a7729
Dont turn on disambiguate keys when receiving th XTMODKEYS escape code
See #4075
2021-10-01 21:26:27 +05:30
Kovid Goyal
eeb02ceef4
Shell integration: Workaround bash not redrawing multiline prompts 2021-10-01 09:30:26 +05:30
Kovid Goyal
06f67e4765
typo in comment 2021-09-30 14:27:22 +05:30
Kovid Goyal
21d3856e90
Another attempt at fixing fish cursor movement 2021-09-30 14:17:01 +05:30
Kovid Goyal
ea186ac48d
Fix click to move cursor in fish multiline text
Thanks to @ridiculousfish, see: https://github.com/kovidgoyal/kitty/issues/3948#issuecomment-930458949
2021-09-30 07:44:30 +05:30
Kovid Goyal
9ab5a03f53
Fix movement of cursor when clicking and dual width chars are present in zsh 2021-09-30 07:38:44 +05:30
Kovid Goyal
a0cee13652
Also turn on extended key reporting for CSI > 4; 2 m
This is supported by XTerm and used by vim. Fixes #4075
2021-09-29 11:12:01 +05:30
Kovid Goyal
10fbf36e92
Silence bells caused by cursor movement after click at prompt 2021-09-29 10:27:13 +05:30
Kovid Goyal
9a3d99515f
Add support for reporting mouse events with pixel co-ordinates using the SGR_PIXEL_PROTOCOL introduced in xterm 359 2021-09-28 11:41:35 +05:30
Kovid Goyal
7d41aca0e4
More word selection direction change fixes 2021-09-27 20:42:22 +05:30
Kovid Goyal
c71d8fe1cc
Fix #4070 2021-09-27 17:29:22 +05:30
Kovid Goyal
1cef544cff
Allow sending escape code to child in chunks 2021-09-24 16:54:04 +05:30
Kovid Goyal
67cef371dc
Allow writing bytes when sending escape code to child 2021-09-24 14:06:09 +05:30
Kovid Goyal
2a8fd278c1
Bring implementation of XTSAVE and XTRESTORE into line with xterm
Now a stack of depth 1 is used to save/restore private mode values. And
saving/restoring individual modes is supported. This latter is used by
midnight commander.
2021-09-14 21:59:41 +05:30
Kovid Goyal
101377d7f2
Better fix for reflow with last line being empty output start line 2021-09-14 14:18:47 +05:30
Kovid Goyal
495981bade
Pass failure to send data to child because of full buffer up the stack 2021-08-25 13:28:50 +05:30
Kovid Goyal
37735b962e
Start work on new file_transmission protocol 2021-08-19 09:23:01 +05:30
Kovid Goyal
fab7cfb113
Handle multiline cursor movement in zsh when clicking 2021-08-18 10:06:10 +05:30
Kovid Goyal
2715947830
DRYer 2021-08-18 10:06:10 +05:30
Kovid Goyal
2472cea69f
Fix resizing causing a line or two from the start of the th last cmd output to be skipped
Resizing causes multiple consecutive lines to be marked as being start
of output, so rewind to the first of them.
2021-08-18 10:06:10 +05:30
Kovid Goyal
81654c9874
Function to check if cursor is at marked prompt 2021-08-18 10:06:09 +05:30
Kovid Goyal
c257adb56a
Add a debug action to dump current lines with their attributes 2021-08-18 10:06:09 +05:30
Kovid Goyal
ef76c075e0
Get rid of bits from CellAttrs 2021-08-18 10:06:08 +05:30
Kovid Goyal
b260a61c8f
Get rid of bits from LineAttrs 2021-08-18 10:06:08 +05:30
Kovid Goyal
780e526143
Use a union for cell attributes
Cleaner code, no performance impact
2021-08-18 10:06:08 +05:30
Kovid Goyal
1f5fa03015
Use a union for line attrs
Allows faster construction of Line objects without needing to set
individual booleans. And cleaner code.
2021-08-18 10:06:08 +05:30
Kovid Goyal
e8832a86bb
Fix scroll_to_prompt for prompts that have been reflowed over multiple lines 2021-08-18 10:06:08 +05:30
Kovid Goyal
fa327d618d
Cursor movement at shell prompts on click
Fixes #3825
2021-08-18 10:06:07 +05:30
Kovid Goyal
196200d03f
Dont reflow the current prompt when resizing
This ensures that there is no leftover line when the shell redraws the prompt,
by making the prompt a simple single character prompt before rewrapping.
2021-08-18 10:06:04 +05:30
Kovid Goyal
07b971ad5f
Add a shortcut to easily browse the output of the last command run in the shell 2021-08-18 10:06:04 +05:30
Kovid Goyal
bd5f100f13
Add test for multiline prompt jumping 2021-08-18 10:06:04 +05:30
Kovid Goyal
3b8da7e4c2
implementation of scroll_to_prompt 2021-08-18 10:06:04 +05:30
Kovid Goyal
0d4237f802
Mark prompt lines 2021-08-18 10:06:04 +05:30
Kovid Goyal
46b9aca16e
Start work on shell integration 2021-08-18 10:06:04 +05:30
Kovid Goyal
dbc7e8e85d
When dragging word or line selections, ensure the initially selected item is never deselected
This matches behavior in most other programs
Fixes #3930
2021-08-13 20:23:43 +05:30
Kovid Goyal
5c7ce18379
Move visual bell code into shaders.c 2021-08-11 12:04:52 +05:30
Andrew Mayorov
aff6fdfa84
Make visual bell flash much more gentle
Right now visual bell makes background flash sharply with bright white
(when configured with darkish color theme). This causes eye strain,
especially prominent in unlit environments.

This change makes background bounce smoothly between regular bg color
and highlight (selection) bg color for the configured visual bell
duration. Intensity is animated with cubic easing functions. It
currently peaks at 20% of the duration, this is hardcoded.

Mark functions computing intensity and easing as inline

Do smarter blending of visual bell flash

Blend highlight color with pegtop's softlight mode over both background
and half as much over foreground. This should help with flash visibility
in light themed and inverted colors contexts.

Blend flash in BACKGROUND pass also

Revert "Do smarter blending of visual bell flash"

This reverts commit 9a269d55c7d04334b1c4891c42914423517dfad6.

Revert "Blend flash in BACKGROUND pass also"

This reverts commit 756332cb9d7576b08db78406e37349aa6d1df156.

Revert "Make visual bell flash much more gentle"

This reverts commit cbfe5d59ada2da690e14c7532a7468b0c307c462.

Render flash overlay in a separate drawcall

Trigger frequent repaints to make for smooth animation

Attenuate flash a bit more
2021-08-11 11:54:43 +05:30
Kovid Goyal
be34af4555
Remove inline from .c files
It is ignored by compilers and hides unused static functions
2021-08-03 09:11:17 +05:30
Kovid Goyal
8f214c51c0
Get rid of kitty's special OSC 52 protocol
A better solution from an ecosystem perspective is to just work with the
original protocol. I have modified kitty's escape parser to special case
OSC 52 handling without changing its max escape code size.

Basically, it works by splitting up OSC 52 escape codes longer than the
max size into a series of partial OSC 52 escape codes. These get
dispatched to the UI layer where it accumulates them upto the 8MB limit
and then sends to clipboard when the partial sequence ends.

See https://github.com/ranger/ranger/issues/1861
2021-07-23 22:18:02 +05:30
Kovid Goyal
cd6b3da665
Fix turning off cursor blink via escape codes not working
Also fix cursor blink stopping after terminal reset. The default cursor
state should be blinking.

Fixes #3808

...
2021-07-07 20:45:46 +05:30
Kovid Goyal
05d0bda044
Allow selecting blanks at the start of the top line 2021-07-04 18:49:17 +05:30
Kovid Goyal
e732df46b8
Have right clicking to extend selection operate on the nearest selection boundary instead of the selection end. This matches both vim and xterm 2021-07-04 18:00:41 +05:30
Kovid Goyal
10d359c222
Better error message for application escape mode
tmux apparently uses it
2021-07-03 12:24:51 +05:30
Kovid Goyal
026d200add
Fix a bug in the implementation of the synchronized updates escape code that could cause incorrect parsing if either the pending buffer capacity or the pending timeout were exceeded
Fixes #3779
2021-07-01 15:32:53 +05:30
Kovid Goyal
fe991ee767
DRYer 2021-07-01 08:53:11 +05:30
Kovid Goyal
5768c54c5b
Add support for pending mode via SM/RM 2026
Because, why the hell not, it's not like I have an actual life.
More seriously, terminal-wg (aka Bikeshedder's Anonymous) is
pushing for it so it's likely at least one poor application writer
will fall for their propaganda.
2021-06-29 12:24:34 +05:30
Kovid Goyal
397638998b
Dont use static memory for the list of chars options
Saves a couple of KB of RAM and is more flexible in terms
of max number of allowed chars, although for large numbers one really
needs a hash for fast lookups.
2021-06-17 13:27:11 +05:30
Kovid Goyal
057084a708
Add support for XTVERSION version reporting escape code 2021-06-14 10:20:50 +05:30