Commit Graph

55 Commits

Author SHA1 Message Date
veltza 118e965d0c
sixel: add support for fully transparent bg (P2=1) (#132)
P2 selects how the terminal draws the background color.

P2                  Meaning
0 or 2 (default)    Pixel positions specified as 0 are set to the
                    current background color.
1                   Pixel positions specified as 0 remain at their
                    current color.

Both modes are now supported.

Ref. https://www.vt100.net/docs/vt3xx-gp/chapter14.html
2024-04-17 18:04:27 +02:00
Bakkeby 06bb70e2d1 externalpipe + reflow: compatibility fix correction ref. #125 2024-03-14 23:26:47 +01:00
Bakkeby d318b3c03f externalpipe + reflow compatibility fix ref. #122 2024-03-14 10:01:37 +01:00
Bakkeby 25a28a61a3 netwmicon_ff - increase buffer size to 16 2024-03-13 11:56:11 +01:00
Stein Gunnar Bakkeby 0b8055a271
netwmicon: upgrading patch and adding farbfeld variant (#121) 2024-03-13 10:35:17 +01:00
Stein Gunnar Bakkeby 3b87b07404
Adding reflow patch (#120) 2024-03-13 10:33:51 +01:00
Bakkeby e88f2bf20c Removing the VIM browse patch.
The general reasoning is that the vim browse patch is very invasive,
has a high level of complexity, and is incompatible with a significant
number of other patches and it complicates further maintenance.

Additionally the patch has its own scrollback mechanism which seemingly
did not work properly - and nobody seems to have complained about this
since the patch was added back in May 2021.

If you want to try out the vim browse patch then I would recommend having
a play around with the patch author's own build that has this patch
integrated:
   - https://github.com/juliusHuelsmann/st-history-vim
   - https://github.com/juliusHuelsmann/st

Alternatively a tag has been added to this repository that refers to the
last commit that still has the vim browse patch:
   - https://github.com/bakkeby/st-flexipatch/tree/VIM_BROWSE_PATCH
2024-03-07 22:35:11 +01:00
Stein Gunnar Bakkeby 677c2da0be
Reworking sixel implementation based on veltza's implementation (#117)
* sixel: remove black bars from sixel images

When the images don't fully cover the text cells, black bars are added
to them. This fix removes those bars, but if you need the old behavior,
you can restore it by setting 'sixelremovebars' to zero in config.h

* sixel: fix a potential memory leak

* sixel: improve behavior with text reflow

* sixel: prevent animated gifs from choking the terminal

Animated gifs constantly spawn new images that eventually choke the
terminal because the old animation frames are kept in the image buffer.
This fix removes overlapping images from the image buffer and prevents
them from piling up.

* sixel: add zooming and clipping

* sixel: copying bulk of changes

* sixel: move sixel_parser_parse() and add missing sequences and blocks (#113)

- Move sixel_parser_parse() from tputc() to twrite()
- Add missing 8452, DECSDM, XTSMGRAPHICS and XTWINOPS sequences
- Add more conditional blocks for the scrollback and sync patches
- Remove unused reflow_y from ImageList. It is only used for the
  scrollback-reflow patch in st-sx.

* sixel: update vtiden to VT200 family

* sixel: fix scrolling issues inside tmux (#114)

tmux is using the scrolling region and sequence to clear the screen
below the shell prompt. This peculiar behavior caused the tscrollup()
function to be called, which always scrolled the images regardless of
whether they were inside the region or not. So the images moved out of
place whenever the bottom of the screen was cleared. This fix checks
that the images are inside the region before scrolling them.

* sixel: prevent images from being deleted when resizing (#115)

This fixes resizing issues outside of tmux not inside.

* Rewriting tresize logic based on veltza's proposed implementation in PR #115

* tresize: correction for tscrollup call when scrollback patch is used

---------

Co-authored-by: veltza <106755522+veltza@users.noreply.github.com>
2024-03-07 09:22:44 +01:00
veltza 003ab067da
Remove black bars from sixel images and add... (#107)
...support for transparency. Technically, the sixels do not have transparency,
but empty pixels are now rendered with the current background color instead
of black to make the them appear transparent. Same goes for the black bars.
The current background color makes them disappear.

There is one technical limitation with the alpha focus highlight patch.
The alpha value and background color is taken from the current background color,
so when the window is unfocused, images may have the wrong alpha and/or
background color. This can't be fixed easily.
2023-11-23 21:45:20 +01:00
Bakkeby d8529b66a4 Adding fullscreen patch ref. #88 2022-10-24 11:27:51 +02:00
badarg1 6ce9ec69ad
Fixed a glitch when using using the keyboardselect and scrollback patches. (#48)
Scrolling back and then entering keyboardselect's copy mode causes
glitched text to appear when moving the cursor. This is because the
keyboardselect patch is not aware of the scrollback history (term.hist),
so it takes the text from the last displayed screen (term.line).

Co-authored-by: Àlex Ramírez <aramirez@verbio.com>
2022-10-17 13:39:34 +02:00
step d58abd5638
dedup XK_Z in fixkeyboardinput.c (#87)
Closes #85.
2022-10-15 15:40:39 +02:00
Bakkeby f899d0552a alpha: remove debug print statements from changealpha 2022-10-01 08:37:17 +02:00
Utkarsh Verma 2d74e49c4f Add function for changing alpha (#47)
Co-authored-by: Stein Gunnar Bakkeby <bakkeby@gmail.com>
2022-09-24 11:04:38 +02:00
step 499b7fbc19
XRESOURCES_RELOAD_PATCH reload fonts + re-render (#84)
This patch 1) improves reloading X resources - by considering fonts in
a way nearly identical to function `zoomabs`' - and 2) re-renders st so
that changed colors and fonts can be seen.
2022-09-24 10:40:33 +02:00
Bakkeby 34cd955f14 Adding key and mouse binding option to control whether they apply to primary screen, alt screen or both ref. #81 2022-09-01 22:01:20 +02:00
Bakkeby 89ced627cd font2: adding use XftFontMatch patch compatibility
Also adding support for using size in addition to
pixelsize when configuring fonts.

Ref. https://github.com/bakkeby/dwm-flexipatch/issues/294
2022-08-29 09:50:47 +02:00
Bakkeby bdeb1e7c4c openurlonclick: using posix_spawnp instead of system ref. comments in #76 2022-08-11 15:04:44 +02:00
Bakkeby 2eca262969 openurlonclick: fix for edge case that can cause a crash 2022-08-11 09:13:29 +02:00
veltza 3eb170a9a5 Add scrollback support to the openurlonclick patch
The openurlonclick and scrollback patches are now working together,
so links can be clicked in the scrollback buffer too. This update also
adds url underlining and other improvements to the openurlonclick patch.

The full list of changes in the openurlonclick patch:
- Adds scrollback support
- Adds modkey option
- Better url detection
- Underlines url when the mouse pointer is over a link
- Opens a browser as a background process, so it won't lock the terminal anymore
- Fixes a segmentation fault bug
2022-08-10 21:32:44 +03:00
Bakkeby 9e0e419781 xresources reload: should close the display after being finished with the connection (if not then it can cause "Maximum amount of clients reached" errors after some time) 2022-07-28 15:48:40 +02:00
veltza a705b714b5 Change Ctrl+l behaviour
From now on, Ctrl+l scrolls up the screen and preserves the scrollback buffer.
Fixes #46.
2022-07-02 12:48:30 +03:00
bakkeby 3e41e252b1 Adding background image reload patch ref. pull request #62 2022-04-11 16:04:58 +02:00
bakkeby 289485bd50 background image: use xmalloc instead of malloc to exit st on malloc failures 2022-03-11 10:17:31 +01:00
bakkeby faac64e392 background image: make sure to close the farbfeld file on error 2022-03-11 09:40:18 +01:00
bakkeby 1a8175a337 Adding background image patch 2022-03-10 13:54:28 +01:00
bakkeby 51dc6ba469 scrollback: do not scroll up when already at the top ref. #57 2022-03-06 14:18:49 +01:00
Komari Spaghetti 45476fccb3 Fix buffer overflows in openurlonclick.c 2021-08-03 16:22:00 +02:00
bakkeby 04a194c013 newterm: dwm swallow compatibility
There is a compatibility issue between the dwm swallow patch and the
newterm patch for st.

The swallow patch identifies the terminal client to substitute by
traversing the process tree checking if the new window is a descendant
of a terminal client.

The newterm patch for st spawns a new terminal that is a descendant of
the parent st process.

This can lead to situations where the swallow patch ends up replacing
the wrong terminal window.

Changed the forking mechanism to do a double fork and letting the
first one die. This is a technique commonly used by daemons to spawn
new orphan processes.
2021-07-12 09:25:52 +02:00
bakkeby ee4cdc8d6e Adding openurlonclick patch ref. #32 2021-07-07 10:08:43 +02:00
bakkeby 426eca8f2e Adding proposed scrollback changes for sixel graphics ref. #30 2021-07-07 09:43:43 +02:00
bakkeby 80bb4b8ab7 externalpipe: sigchld changes interfere with right-click-to-plumb and opencopied patches, proposed fix ref. #27 2021-05-15 11:44:09 +02:00
bakkeby e039854635 Adding vim browse patch ref. #21 2021-05-09 17:48:28 +02:00
bakkeby 56e208e0de Adding sync patch ref. #21 2021-05-09 09:25:22 +02:00
bakkeby 3b88d65645 copyurl: upgrading to support non-ascii URLs ref. #21 2021-05-09 08:08:51 +02:00
bakkeby a5435903d4 Adding universcroll patch ref. #21 2021-05-08 17:49:04 +02:00
bakkeby 8c8bace91c Adding netwmicon patch ref. #21 2021-05-08 14:50:06 +02:00
bakkeby 0fade9158a xresources reload: minor style changes ref. #16 2021-05-07 09:27:05 +02:00
Loic Coyle 540a923fb9 Add XRESOURCES_RELOAD_PATCH 2021-04-24 00:30:14 +02:00
bakkeby f31c43015d Adding sixel support ref. #7 2021-03-25 11:10:57 +01:00
bakkeby 6c42872476 keyboardselect: style changes 2021-02-24 08:52:22 +01:00
Kipras Melnikovas c148334008
fix keyboardselect patch when combined with ligatures patch
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
2021-02-24 00:58:48 +02:00
bakkeby 5c7d8ab1ad auto-sync: draw on idle to avoid flicker/tearing
st could easily tear/flicker with animation or other unattended
output. This commit eliminates most of the tear/flicker.

Before this commit, the display timing had two "modes":

- Interactively, st was waiting fixed `1000/xfps` ms after forwarding
  the kb/mouse event to the application and before drawing.

- Unattended, and specifically with animations, the draw frequency was
  throttled to `actionfps`. Animation at a higher rate would throttle
  and likely tear, and at lower rates it was tearing big frames
  (specifically, when one `read` didn't get a full "frame").

The interactive behavior was decent, but it was impossible to get good
unattended-draw behavior even with carefully chosen configuration.

This commit changes the behavior such that it draws on idle instead of
using fixed latency/frequency. This means that it tries to draw only
when it's very likely that the application has completed its output
(or after some duration without idle), so it mostly succeeds to avoid
tear, flicker, and partial drawing.

The config values minlatency/maxlatency replace xfps/actionfps and
define the range which the algorithm is allowed to wait from the
initial draw-trigger until the actual draw. The range enables the
flexibility to choose when to draw - when least likely to flicker.

It also unifies the interactive and unattended behavior and config
values, which makes the code simpler as well - without sacrificing
latency during interactive use, because typically interactively idle
arrives very quickly, so the wait is typically minlatency.

While it only slighly improves interactive behavior, for animations
and other unattended-drawing it improves greatly, as it effectively
adapts to any [animation] output rate without tearing, throttling,
redundant drawing, or unnecessary delays (sounds impossible, but it
works).
2020-05-20 14:15:57 +02:00
bakkeby b71d9f6669 [st][PATCH] externalpipe and externalpipein
This patch must be applied on the externalpipe patch. It adds the
function externalpipein to redirect the standard output of the external
command to the slave size of the pty, that is, as if the external
program had been manually executed on the terminal. It can be used to
send desired escape sequences to the terminal with a shortcut.

I created the patch to make use of the dynamic-colors program
(https://github.com/sos4nt/dynamic-colors) that uses the OSC escape
sequences to change the colors of the terminal. The program keeps the
last colorscheme selected in a file, so you can use it to select the
colorscheme for all newly opened terminals from that moment on. If you
want to change the color of the background and foreground independently
from the palette, you have to merge in the patch for the OSC escape
sequences 10, 11, and 12.

This patch includes the changes of the externalpipe sigaction patch to
prevent reseting the signal handler for SIGCHLD when the proces of the
external command exits.
2020-04-20 13:06:39 +02:00
bakkeby d26b46ffa7 Adding invert patch 2020-03-29 15:38:16 +02:00
bakkeby e7cfd5ae16 better Input Method Editor (IME) support (35f7db) 2020-03-24 11:25:39 +01:00
bakkeby 9f1a2db7c5 Adding font2 patch as per request #3 2020-03-21 16:41:43 +01:00
bakkeby 352170eec8 Adding st embedder patch 2020-01-07 14:05:53 +01:00
bakkeby dc915b6056 Adding note about flexipatch-finalizer 2019-10-16 12:05:53 +02:00
bakkeby cfecd195ba Adding relativeborder, fix-keyboard-input, iso14755, visualbell, rightclicktoplumb, boxdraw and keyboard-select patches 2019-09-17 15:16:22 +02:00