Commit graph

1484 commits

Author SHA1 Message Date
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
Daniel Eklöf
d3071b817e
main: add --login-shell command line option 2020-02-20 18:34:23 +01:00
Daniel Eklöf
ec3c699fde
README: list 'lightweigh' under features 2020-02-18 10:12:38 +01:00
Daniel Eklöf
06d20b0dee
PKGBUILD: meson already adds these flags 2020-02-16 14:40:59 +01:00
Daniel Eklöf
3073b88d09
meson: always disable stack-protector and enable strict-aliasing 2020-02-16 14:40:15 +01:00
Daniel Eklöf
cea75625e2
log: always log file:lineno 2020-02-16 14:40:08 +01:00
Daniel Eklöf
3e6321155e
meson: strip build relative paths from file macros 2020-02-16 14:40:02 +01:00
Daniel Eklöf
38a682f0d0
render/grid: move grid reflow code to grid.c 2020-02-15 22:19:08 +01:00
Daniel Eklöf
304f8d6982
wayland: output_mode: update PPI
Since we now use the width/height values from output_mode(), we also
need to update the PPI here.
2020-02-15 21:31:23 +01:00
Daniel Eklöf
f0887df5c5
main: bug: -t requires an argument 2020-02-15 21:05:53 +01:00
Daniel Eklöf
fc66c5f676
README: change wording of DPI header 2020-02-15 21:02:18 +01:00
Daniel Eklöf
593dad7d2b
README: talk about DPI, add font on-the-fly features to feature list 2020-02-15 20:59:34 +01:00
Daniel Eklöf
5b98510ea4
doc: foot.5: make 'pad' syntax/example clearer 2020-02-15 19:51:11 +01:00
Daniel Eklöf
34049af252
PKGBUILD: experimental: build with -fstrict-aliasing 2020-02-15 19:46:29 +01:00
Daniel Eklöf
db830643d2
shm: prefer posix_fallocate over ftruncate 2020-02-15 19:46:00 +01:00
Daniel Eklöf
291410bd71
wayland: debug: make sure state_str is properly NULL terminated 2020-02-15 19:30:59 +01:00
Daniel Eklöf
1a808d2552
Merge branch 'font-dpi-adjust-on-the-fly' 2020-02-15 19:16:22 +01:00
Daniel Eklöf
4d3ab6176d
term: implement term_font_dpi_changed()
This function reloads the font *if* the DPI has changed. To handle
user run-time adjusted font sizes, we record the number of adjustments
made.

Then, when re-loading the font, we first load the font as specified in
the configuration. Then, we re-apply the size adjustment using
font_size_adjust().

Note that this means we end up loading the fonts twice; first using
the default size (but with adjusted DPI), and then again with the
adjusted size. This can probably be improved upon.

The existing font code has been refactored to avoid code
duplication. For example, term_init() now calls
term_font_dpi_changed() to load the initial fonts, instead of directly
instantiating them.

Finally, the way we calculate the DPI to use has changed: instead of
using the highest DPI of all available outputs, we use the highest DPI
of the output's we're actually mapped on. If we're not mapped at all,
we use the globally highest DPI.

Doing it this way means we usually only have to load the fonts
once. Otherwise, we'd end up using the default DPI of 96 when the
terminal is first instantiated (since it's not mapped at that time).

On a single monitor system, we'll use the globally highest DPI at
first, before being mapped. Then when we get mapped, we re-load the
fonts using the highest mapped DPI. But since they'll be the same,
we can skip actually reloading the fonts.
2020-02-15 19:08:14 +01:00
Daniel Eklöf
027696e9c6
wayland: calculate DPI from physical size, not logical size
xdg_output_handle_logical_size() reports _logical_ output size. That
is, it is scaled by the output's scale factor.

We want the _actual_ DPI. The _real_ output size is reported by
output_mode(), so use that instead.
2020-02-15 19:06:28 +01:00
Daniel Eklöf
ffcb09dd75
wayland: break out scale/resize updating to a new function
And call this function once from output_done(), rather than from each
output_*() callback.
2020-02-15 19:05:33 +01:00
Daniel Eklöf
e5253ca737
input: fix xcursor getting stuck
Apparently, a frame callback for the cursor surface is *never*
triggered if we get a pointer-leave event *before* the callback is
triggered. At least on Sway 1.4.

This caused the cursor being stuck, and never updating once this state
was reached.

Fix by destroying the cursor frame callback on pointer-leave.
2020-02-15 19:02:43 +01:00
Daniel Eklöf
26a8d4b8a1
Merge branch 'configurable-padding' 2020-02-15 19:02:21 +01:00
Daniel Eklöf
faf3bdaec3
doc: foot.5: document new 'pad' configuration option 2020-02-15 19:02:05 +01:00
Daniel Eklöf
7f211d8f03
footrc: add 'pad' option 2020-02-15 19:01:54 +01:00
Daniel Eklöf
b036a66c42
render: resize: take padding from configuration into account 2020-02-15 19:01:26 +01:00
Daniel Eklöf
9ab9247b88
config: add 'pad' option, default to 2 2020-02-15 19:00:56 +01:00
Daniel Eklöf
a089d6264d
Merge branch 'text-reflow-fixes' 2020-02-15 19:00:18 +01:00
Daniel Eklöf
f07a124c11
render: reflow: set 'linebreak' flag before inserting new line 2020-02-15 18:59:21 +01:00