Commit graph

1511 commits

Author SHA1 Message Date
Daniel Eklöf
a2b4bcbd4f
sixel: track which grid image was created on 2020-02-23 00:40:30 +01:00
Daniel Eklöf
86d640ef71
sixel: rename: purge_at_cursor() -> delete_at_cursor() 2020-02-22 23:06:11 +01:00
Daniel Eklöf
3a24777e45
Merge branch 'sixel-graphics' 2020-02-22 22:06:14 +01:00
Daniel Eklöf
5c7fc3a0c7
README: add screenshot of sixel graphics 2020-02-22 22:04:28 +01:00
Daniel Eklöf
270b7cc6f4
sixel: purge images in unhook, rather than in init
This fixes an issue where the cursor was seen blinking in animated
GIFs.
2020-02-22 21:55:10 +01:00
Daniel Eklöf
80361ca04e
sixel: purge images at current cursor row
When printing a character, or starting a new sixel image, purge all
images that cover the cursor's current row.
2020-02-22 21:35:45 +01:00
Daniel Eklöf
462229af70
sixel: oops 2020-02-22 21:24:21 +01:00
Daniel Eklöf
6e8c4149d2
README: add sixel support to feature list 2020-02-22 21:21:14 +01:00
Daniel Eklöf
05ff2a8a15
sixel: don't ever shrink the image 2020-02-22 21:20:22 +01:00
Daniel Eklöf
f96eb5ff07
sixel: add HLS color format support 2020-02-22 21:18:55 +01:00
Daniel Eklöf
7985cefd65
sixel: add comments to max_width()/max_height() 2020-02-22 21:04:24 +01:00
Daniel Eklöf
25b09b909c
sixel: application configurable image max width/height 2020-02-22 21:03:24 +01:00
Daniel Eklöf
8e37a18083
sixel: application configurable palette size (color count)
This implements the CSI escapes for retrieving and (re)setting the
palette size.
2020-02-22 14:02:00 +01:00
Daniel Eklöf
5e65db3b07
sixel: use terminal's background color, not palette[0] 2020-02-22 14:01:20 +01:00
Daniel Eklöf
a9971f4c32
csi: DA: we now implement sixel 2020-02-22 12:16:19 +01:00
Daniel Eklöf
23d39e6f90
sixel: finalize: use width/height from image, not row/col pos 2020-02-22 11:52:48 +01:00
Daniel Eklöf
a8dc61d0ff
sixel: resize: initialize new rows/columns with the background color 2020-02-22 11:52:22 +01:00
Daniel Eklöf
a418521ced
sixel: mention why we add one 2020-02-22 11:37:25 +01:00
Daniel Eklöf
7625264851
sixel: clean up state machine
Use proper state names, and implement the state machine using switch
statements.
2020-02-22 11:30:30 +01:00
Daniel Eklöf
f193695960
sixel: use a struct coord for current sixel position 2020-02-22 10:54:52 +01:00
Daniel Eklöf
1b728dcac8
sixel: rename state SIXEL_SIXEL -> SIXEL_GROUND 2020-02-22 10:50:05 +01:00
Daniel Eklöf
87193ff339
sixel: raster: only resize image buffer if necessary 2020-02-22 10:49:00 +01:00
Daniel Eklöf
ad5b2030f0
term: free sixel images on reset 2020-02-22 10:47:16 +01:00
Daniel Eklöf
b03ffa3720
sixel: resize image buffer after receiving a "raster" command 2020-02-22 10:46:54 +01:00
Daniel Eklöf
00c6d4dde1
sixel: resize image buffer dynamically 2020-02-22 10:46:35 +01:00
Daniel Eklöf
bb82b9fabc
sixel: add sixel_destroy() 2020-02-22 00:23:19 +01:00
Daniel Eklöf
6f84b79810
sixel: always bump row on unhook 2020-02-22 00:19:38 +01:00
Daniel Eklöf
da76b8cbf8
sixel: ugly hack to remove over-written sixel images 2020-02-22 00:10:42 +01:00
Daniel Eklöf
63140a68f5
sixel: calculate image height in (cell) rows 2020-02-22 00:05:25 +01:00
Daniel Eklöf
564e8909f4
render: break out sixel rendering code 2020-02-21 23:48:45 +01:00
Daniel Eklöf
f0fc82f098
sixel: wip: maintain a list of finished, and "active" sixel images
In unhook, add the generated image to a list of finished sixel images,
along with positioning and size information.

When rendering, loop this list of images, and render the images (or
parts of) that are visible.

When scrolling, check if any part of the images cover the re-cycled
lines, and if so, remove the *entire* image from the list.

This means we have the following limitations:

* The renderer always renders the whole (visible area of) the
  image(s). There are times when this isn't necessary - for example,
  when the image is scrolled inside the visible area.
* It would be nice if we could crop the image when parts of it is
  scrolled out.
2020-02-21 23:40:35 +01:00
Daniel Eklöf
f81bdfeed5
Merge branch 'master' into sixel-graphics 2020-02-21 23:38:57 +01:00
Daniel Eklöf
a1b5862db2
scroll-up: ensure view is valid after adjusting an overshot scrollback
When we scroll up, we need to ensure that we don't scroll too far,
"past" the scrollback limit. I.e. we need to ensure we don't wrap
around.

The code did this. But, in certain scenarios, the resulting view
points into uninitialized scrollback history.

This happens when we haven't yet filled the entire scrollback, and
scroll up enough lines to wrap around the scrollback. The old code
would adjust the view for the wrap around, but doing so pointed the
view at the not-yet utilized scrollback.
2020-02-21 23:35:43 +01:00
Daniel Eklöf
9e3bfb1eab
sixel: initial support
This implements basic parsing of sixel data. Lots of limitations and
temporary solutions as this is still work-in-progress:

* Maximum image size hardcoded to 800x800
* No HLS color format support
* Image is always rendered at 0x0 in the terminal
2020-02-21 21:53:23 +01:00
Daniel Eklöf
e8197d22f7
keymap: tab: handle all modifiers
Tab is one of the keys included in our "otherModifierKeys"
implementation. However, since the key sym falls outside the checks
required to trigger it, special case it and implement its sequences as
a table.
2020-02-21 19:14:46 +01:00
Daniel Eklöf
ae23023341
keymap: align backspace escapes with XTerm
Backspace now emits DEL for all non-ctrl modifier combos, and BS for
all ctrl modifier combos.

The alt modifier prefixes DEL/BS with ESC.

This also removes my own hack of mapping ctrl+backspace to
alt+backspace.

Describe backspace behavior in both the README and the man page.

TODO: implement DECBKM to allow applications to toggle the backspace
behavior.
2020-02-21 19:11:03 +01:00
Daniel Eklöf
54fbfb6405
client: make sure 'cwd' is in scope of all goto's 2020-02-20 20:21:34 +01:00
Daniel Eklöf
3f3f1add9c
doc: foot.5: login-shell: add default value ('no') 2020-02-20 18:53:00 +01:00
Daniel Eklöf
84e54033ae
doc: foot.5: change 'shell' example, add login-shell 2020-02-20 18:49:23 +01:00
Daniel Eklöf
eed5052ce8
main: check return value of getcwd() 2020-02-20 18:46:45 +01:00
Daniel Eklöf
f1b1ac39f6
slave: check return value of chdir() 2020-02-20 18:46:35 +01:00
Daniel Eklöf
01f8719c77
term: spawn_new: check return value of chdir() and write() 2020-02-20 18:46:16 +01:00
Daniel Eklöf
e751227dc6
client: allocate current working directory buffer dynamically 2020-02-20 18:45:42 +01:00
Daniel Eklöf
bb3c20e284
Merge branch 'login-shell' 2020-02-20 18:37:16 +01:00
Daniel Eklöf
c1561e0c50
doc: add --login-shell 2020-02-20 18:36:52 +01:00
Daniel Eklöf
87c956352f
completions: zsh: add --login-shell 2020-02-20 18:36:43 +01:00
Daniel Eklöf
984950f269
footrc: add login-shell option 2020-02-20 18:36:34 +01:00
Daniel Eklöf
b5efe984bb
slave: prefix argv[0] with a '-' when spawning a login-shell 2020-02-20 18:36:09 +01:00
Daniel Eklöf
6af4b87ec5
config: add 'login-shell' option 2020-02-20 18:35:10 +01:00
Daniel Eklöf
8dee9bf942
client: add --login-shell command line option 2020-02-20 18:34:51 +01:00