bakkeby / st-flexipatch Goto Github PK
View Code? Open in Web Editor NEWAn st build with preprocessor directives to decide which patches to include during build time
License: MIT License
An st build with preprocessor directives to decide which patches to include during build time
License: MIT License
Alacritty has this and I'd love to have it in st -- once you hover over to some colorful character, the cursor's background becomes that color, and the character becomes transparent or swapped or similar.
This is something similar to ATTR_REVERSE
and disabling the spoiler patch, but more like for general editing in say (neo)vim.
I was interesting in trying to implement a click url method as I wasn't really a fan of having to put the link in my clipboard history before being able to right click the link (through the right click to plumb patch). With a cursory google search, I stumbled across this reddit post. Would you be willing to include the patch provided in the post with this repo? If not, no big deal; it was pretty easy to include myself.
The patch url: https://st.suckless.org/patches/autocomplete/
There is a newer version in the git repo: https://gitlab.com/GasparVardanyan/st-autocomplete/-/tree/master/test-releases
Please note that this patch is under testing state and sometimes crashes.
Before I push a PR I need to ask. Is there any good reason why key XK_Z
is duplicated in patch/fixkeyboardinput.c?
As the title says, the patches don't seem to work together. If they're all enabled (or external pipe and one of the others is enabled) using the opencopied command or making a right click on a selection freezes the st window. I assume that this is probably intentional, but I thought I'd ask because I'm not sure.
I would really like to have the ability of having both the external pipe and right-click-to-plumb. If indeed these two patches aren't meant to work out of the box together, is there a way to make them cooperate? It looks like there's a newer version of right-click-to-plumb if that helps https://st.suckless.org/patches/right_click_to_plumb/
I cannot mouse scroll in manpages with st-flexipatch
I have enabled the scrollback, scrollback-mouse and scrollback-mouse-altscreen patches. Scrolling with the mouse works in the terminal but not in manpages specifically.
Interestingly manpage mouse scrolling works in Distrotube's build https://gitlab.com/dwt1/st-distrotube
I tried replacing the kscrollup and kscrolldown bindings in config.h with the bindings that DT used
{ XK_ANY_MOD, Button4, kscrollup, {.i = 3}, 0, /* !alt */ -1 },
{ XK_ANY_MOD, Button5, kscrolldown, {.i = 3}, 0, /* !alt */ -1 },
However when I do this I get the following warning:
[matt@mpc ~/st-flexipatch]$ sudo make install
c99 -I/usr/X11R6/include `pkg-config --cflags fontconfig` `pkg-config --cflags freetype2` `pkg-config --cflags harfbuzz` -DVERSION=\"0.8.4\" -D_XOPEN_SOURCE=600 -O1 -c st.c
c99 -I/usr/X11R6/include `pkg-config --cflags fontconfig` `pkg-config --cflags freetype2` `pkg-config --cflags harfbuzz` -DVERSION=\"0.8.4\" -D_XOPEN_SOURCE=600 -O1 -c x.c
In file included from x.c:59:
config.h:192:87: warning: excess elements in struct initializer
192 | { XK_ANY_MOD, Button4, kscrollup, {.i = 3}, 0, /* !alt */ -1 },
| ^
config.h:192:87: note: (near initialization for ‘mshortcuts[0]’)
config.h:193:87: warning: excess elements in struct initializer
193 | { XK_ANY_MOD, Button5, kscrolldown, {.i = 3}, 0, /* !alt */ -1 },
| ^
config.h:193:87: note: (near initialization for ‘mshortcuts[1]’)
c99 -I/usr/X11R6/include `pkg-config --cflags fontconfig` `pkg-config --cflags freetype2` `pkg-config --cflags harfbuzz` -DVERSION=\"0.8.4\" -D_XOPEN_SOURCE=600 -O1 -c hb.c
c99 -o st st.o x.o hb.o -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXft -lXrender `pkg-config --libs fontconfig` `pkg-config --libs freetype2` `pkg-config --libs harfbuzz`
mkdir -p /usr/local/bin
cp -f st /usr/local/bin
chmod 755 /usr/local/bin/st
mkdir -p /usr/local/share/man/man1
sed "s/VERSION/0.8.4/g" < st.1 > /usr/local/share/man/man1/st.1
chmod 644 /usr/local/share/man/man1/st.1
tic -sx st.info
7 entries written to /usr/share/terminfo
mkdir -p /usr/local/share/applications # desktop-entry patch
cp -n st.desktop /usr/local/share/applications # desktop-entry patch
Please see the README file regarding the terminfo entry of st.
In addition, those keybinds are the same keybinds that are used in the scrollback-altscreen patch on the suckless site so I'm not sure why I'm thrown such a warning.
How could this be fixed?
How does st look for the bold variants of the font? I want to tell st to use a semibold font instead of the bold one. How do I make st behave like this?
I wrote a fontconfig rule to modify the weight of the bold font to semibold and the rule works in fc-match
, but st still doesn't pick it up.
# make install
$ nvim
$ nvim
outputs this to stdout:
ABORT: lookup_next within a TYPE_KEY node
zsh: abort (core dumped) nvim
$ env -i TERM=ansi-256color "$(which nvim)"
runs nvim
successfully though. $ nvim
runs normal on a fresh st
clone.
I was not able to reproduce this on regular st
.
referencing: gokcehan/lf#288
st-flexipatch
would sometimes display incomplete UI for the file manager lf
.
Steps to reproduce:
SCROLLBACK_PATCH
and SCROLLBACK_MOUSE_PATCH
in patches.h
$ while sleep 0.1; do st -e lf; done
and press q
in lf
It could take several tries to see something like
instead of
Sometimes it's the first try, sometimes it's the 27th. With other patches (I can't try them all in combinations to be precise) this gets more frequent.
when i run make
command, then it'll show error:
/usr/bin/ld: cannot find -lXcursor
collect2: error: ld returned 1 exit status
make: *** [Makefile:33: st] Error 1
after install libxcursor-dev , there's no more error.
If i compile the original source code from suckless.org , everything is fine and i don't have to install this extra dependency (libxcursor-dev), so can you remove this extra dependency or tell us explicitly why we need to install this extra dependency?
## my system:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux bullseye/sid
Release: testing
Codename: bullseye
$ uname -a
Linux debian 5.6.0-1-amd64 #1 SMP Debian 5.6.7-1 (2020-04-29) x86_64 GNU/Linux
Please consider replacing current incomplete (and partially broken) implementation of sixel with a self-made patch based on works of https://github.com/galatolofederico/st-sixel. Mentioned project has a lot more complete implementation of sixel. Or you can use mentioned project as a source of bugfixes for sixel.
Currently there are 3 similar patches:
but under none of them is written about their relationships (they conflict with each other
or one depends on the other).
Would like to request this patch. Thanks.
https://st.suckless.org/patches/font2/
I don't know yet if this is a bug or not. But since ANYSIZE_NOBAR_PATCH
causes
a redraw, which causes hxev
to spam a continuous stream of messages like:
PropertyNotify event, serial 34, synthetic NO, window 0x2600001,
atom 0x157 (_NET_WM_STATE), time 2364461, state PropertyNewValue
This is reproducible as it turns out to be Xmonad but not in dwm, so it's not clear if this
is a bug or Xmonad's distinction.
$ st -e dash -c 'printf "a\nb\n" | fzf --border rounded --color dark'
The top few characters are garbage that is not indented to be here. Sleeping for 0.1 seconds before calling fzf and the garbage is gone:
$ st -e dash -c 'sleep 0.1s; printf "a\nb\n" | fzf --border rounded --color dark'
Currently, I have a patch locally that removes the code in st that waits for the window to start up. My theory is that st does not respond to fzf with correct information in time (or something like that). Unsure if this is the right fix. I'm assuming there must have been some good reason to wait for the window (though I don't quite see what that would be).
diff --git a/x.c b/x.c
index 52c7348..22b5b02 100644
--- a/x.c
+++ b/x.c
@@ -3088,22 +3088,6 @@ run(void)
struct timespec seltv, *tv, now, lastblink, trigger;
double timeout;
- /* Waiting for window mapping */
- do {
- XNextEvent(xw.dpy, &ev);
- /*
- * This XFilterEvent call is required because of XOpenIM. It
- * does filter out the key event and some client message for
- * the input method too.
- */
- if (XFilterEvent(&ev, None))
- continue;
- if (ev.type == ConfigureNotify) {
- w = ev.xconfigure.width;
- h = ev.xconfigure.height;
- }
- } while (ev.type != MapNotify);
-
ttyfd = ttynew(opt_line, shell, opt_io, opt_cmd);
cresize(w, h);
How make scrolling with mouse wheel faster, what I need to change for it?
(I set its in my patches.h
:
#define SCROLLBACK_PATCH 1
#define SCROLLBACK_MOUSE_ALTSCREEN_PATCH 1
)
https://st.suckless.org/patches/scrollback/st-scrollback-ringbuffer-0.8.5.diff
i personally don't know the differences between this new scrollback patch that uses a ring buffer.
t is also said that it is "more efficient" in scrolling.
and if this is quite better, is there a way to port the column reform patch to this ringbuffer scrollback patch? and also add it to st-flexipatch?
Hi! Would it be possible to include the palettes / colour schemes st patch for flexipatch? I'd love to make use of it in my current flexipatch build to cycle between a black-and-white palette and a standard 16-colour palette on the fly, but for now that seems to be missing from flexipatch entirely.
Adding this here for reference. The alpha compatibility for sixel graphics is not quite there and colors blend into the background when transparency is used against a white background.
This is believed to be due to that the sixel graphics use RGB colors instead of RGBA. If anyone knows how to do this properly then help would be appreciated.
Literally the title. If you try to launch st
with a different process name besides $TERM
(in my case, dwm-flexipatch's scratchpads patch seems to do so) while having in your .Xresources
, for example, some sexy colorscheme, then that colorscheme won't get applied. Is there any fix for that?
Would it be possible to add the glyphs "▏" and "▎" to the boxdraw patch? I use them for git signs and indentlines in my nvim config and having these drawn as long lines would be awesome.
By the way, Alacritty and foot seem to include this glyph by default, so maybe their source code could be helpful here.
Left is Alacritty and st on the right.
You can see that the glyphs are not being joined in the case of st.
hello, is it possible that the sixel patch from this repository (assuming it works), can be extracted for manual patching use?
I have had this problem for months and it has killed me inside.
Essentially, when I use maim to take a screen and xclip to copy it to the clipboard, most of the time it doesn't work and when I try to paste it in Firefox it freezes for several seconds. I have been totally unable to solve this and I can screenshot every other thing, except my terminal.
I've had to use Flameshot for a lot of stuff now which I hate for multiple reasons and even then, sometimes it doesn't work properly. Today I made a fresh st-flexipatch and the problem still, annoyingly, persists.
Has anybody got any clue how to fix this? I might have to finally say goodbye to st and try something like alacritty to see if the problem is solved on another terminal.
I'm trying to compile but got a weird error.
This is output of make
st build options:
CFLAGS = -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread -DVERSION="0.8.5" -D_XOPEN_SOURCE=600 -O1
LDFLAGS = -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXft -lXrender -lfontconfig -lfreetype -lfreetype -lharfbuzz
CC = c99
c99 -I/usr/X11R6/includepkg-config --cflags fontconfig
pkg-config --cflags freetype2
pkg-config --cflags harfbuzz
-DVERSION="0.8.5" -D_XOPEN_SOURCE=600 -O1 -c st.c
In file included from st.c:5:
/usr/local/include/limits.h:4:10: fatal error: arch/limits.h: No such file or directory
4 | #include <arch/limits.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:25: st.o] Error 1
[ble: exit 2]
This is weird.. I got previews in lf** running with lfimg*** using ueberzug no problem in st-flexipatch when starting lf withing st.
But when I use st -e lf
in a shortcut the image preview is broken on images and videos..
patches applied:
ALPHA_PATCH 1
COLUMNS_PATCH 1
HIDE_TERMINAL_CURSOR_PATCH 1
KEYBOARDSELECT_PATCH 1
SYNC_PATCH 1
UNIVERSCROLL_PATCH 1
WIDE_GLYPHS_PATCH 1
XRESOURCES_PATCH 1
XRESOURCES_RELOAD_PATCH 1
** https://github.com/gokcehan/lf
*** https://github.com/cirala/lfimg
I don't even know if this is an st issue..
I am trying to install the Nord Theme patch, but it doesn't seem to be working. How can I use st-flexipatch to install the Nord theme, or any other patch that is not included?
Unicode 9 added glyphs and emojis that are 2 characters wide instead of one which has caused problems for me like overlap with text (adding a space fixes this which isn't a huge issue) and the main issue of characters in a line that contains a 2 char wide glyph getting deleted. It's quite random and it can be worked around but is very annoying regardless. Letters in words can be deleted randomly just because I have a desktop emoji in the same line.
This is also an st issue, not restricted to flexipatch and afaik some terminals have fixed the issue but not st. Anyone know how it could be fixed?
Hello, thanks for an excellent tool. Having patched and installed included patches to my heart's content, I now wish to patch st-solarized-dark-0.5.diff, which isn't included. The perequisite no-bold-colors.diff is included in flexiptach. Can I just patch st-flexipatch/config by hand at the alpha patch stage? Or, must I await it's possible inclusion into the flexiptach project?
could the rightclickpaste patch be added
Referencing hackerb9/lsix#32.
Base patch: https://gist.github.com/saitoha/70e0fdf22e3e8f63ce937c7f7da71809
Forks of patch in action:
First of all, thank you for this! As someone not too comfortable with C this is a great starting point/reference for working with st.
The only thing I miss is having a blinking cursor. Is this possible to include?
The current sixel patch doesn't respect the border offset set by the anysize
patch.
The fix is simple, just add the following in x.c
in xfinishdraw()
:
#if ANYSIZE_PATCH
XCopyArea(xw.dpy, (Drawable)im->pixmap, xw.buf, gc, 0, 0, im->width, im->height, win.hborderpx + im->x * win.cw, win.vborderpx + im->y * win.ch);
#else
XCopyArea(xw.dpy, (Drawable)im->pixmap, xw.buf, gc, 0, 0, im->width, im->height, borderpx + im->x * win.cw, borderpx + im->y * win.ch);
#endif
I'm too busy right now to work up a PR, sorry.
When I use neovim in st I get these errors:
erresc: unknown csi ESC[22;0;0t
erresc: unknown csi ESC[22;0t
erresc: invalid color j=258, p=?
erresc: unknown csi ESC[23;0;0t
erresc: unknown csi ESC[23;0t
This only happens when I use nvim and I have seen other people with this error but I haven't found a fix for it. I do know that distrotube's build doesn't have this issue however I don't want to switch to his build. These errors annoyingly clog up the ~/.xsession-errors file
Hi,
I got many Directories that have .git directory inside, and when I try to "cd"
inside such directory with st, it crashes!
This issue is also in the stock st app (I have tryed 0.8.4 version).
Have you noticed that, you too?
Otherwise, all I have tryed so far, works very well.
Rgds,
Most terminals(e.g. Alacritty) have this thing where pressing Ctrl + l
only scrolls the shell prompt to the top, while keeping the scrollback history.
In st
, however, this keybinding clears the scrollback buffer as well. As it's not to my preference, could you please let me know which section of the code should I look into?
Hello and first of, thank you so much for create this awesome project, without this i will never even thinking about using of patching ST. But there are some patches that i think should be included in the project:
ANSI escape sequences (e.g: OSC and SGR parameters) are the standard that all terminal should supported, it's enable some tool such as
bui-terminal
to handle changing color scheme on-the-fly (doesn't need to restart the terminal) and cross-terminal without having to config individual terminal (some of which doesn't support xresources).
blinking_cursor
(mentioned in #20): to control cursor's lookosc_10_11_12_2
: change terminal's colorschemexclearwin
: clears the window before the redraw of the terminal when the bg color has been changedundercurl
(mentioned in #20): support for special underlinesdesktopentry
: creates a desktop-entry for st. This enables to find st in a graphical menu and to display it with a nice iconnetwmicon
: enables to set _NET_WM_ICON which hardcodes an icon for st:
Generally the icon of an application is defined by its desktop-entry. A patch with the name
desktopentry
already exists for this purpose. However, some programs like tint2 do not respect the desktopentry and rely instead on an hardcoded icon which has to be defined by _NET_WM_ICON. Since st does not define _NET_WM_ICON those programs will display some default icon (which is ugly).
sync
: better draw timing to reduce flicker/tearing and improve animation smoothnessdelkey
: return BS on pressing backspace and DEL on pressing the delete keyuniverscroll
: always use Mouse{4,5} to scroll {Up,Down}. Doesn't matter alt screen or not. No more ^Y^Y^Y^Y^Y^E^E^E^E^E
!Features that can be achieved through using terminal multiplexers or other utility.
vim_browse
: move through the terminal history-buffer, search for strings using VIM-like motions, operations and quantifiersdelete keyLIGATURES_PATCH for some reason completely breaks rendering of BOXDRAW_PATCH. LukeSmithxyz/st works fine. Here's screenshot:
I am observing this weird behaviour with the following key config:
chscale: 1.1
font: Comic Code Ligatures
vertcenter enabled
You can quickly test this with my build of st: https://github.com/UtkarshVerma/st-flexipatch/tree/no-reflow
i have the command "wal -i ~/Downloads/wallpaper.jpg" in my autostart but st starts with the default colors, after typing the same command in the terminal it works
Sorry to make intermittent requests, but I was wondering if you'd be willing to implement the swapmouse patch?
I have binded ncmpcpp-uezberg to a key in my dwm config (static const char *music[] = {"st", "-e" , "/home/sophos/.config/ncmpcpp/ncmpcpp-ueberzug/ncmpcpp-ueberzug"};
). When I use this keybinding unicode characters aren't displayed.
Left window is how it should look, right window is how it looks when opened with the keybind.
This doesn't happen when I open the terminal first and then enter the command. It also doesn't happen if I open it using the command st -e /home/sophos/.config/ncmpcpp/ncmpcpp-ueberzug/ncmpcpp-ueberzug
either. It works fine with normal ncmpcpp.
It works as it should on alacritty.
Request: https://st.suckless.org/patches/ligatures/
Thanks.
coc-explorer link https://github.com/weirongxu/coc-explorer
Hi @bakkeby , st cuts text inside it when st's window is resized :/ . Most terminals dont do this. I didnt find any patches for it either.
I found a build which has this issue fixed , seems like it extends the patch column from here.
@BeyondMagic 's build didnt provide any patch for it tho , I found some useful commits BeyondMagic/flarity@4339de9.
( st without patch column and with it (beyondmagic's build) )
It would be very nice if there was a patch for this :]
I had this problem before and applying a newer CSI patch fixed it, however these errors seem to have returned whenever I do st -e nvim
erresc: unknown csi ESC[>4;2m
erresc: unknown csi ESC[>4;0m
Opening nvim in st normally is fine, it's when I do st -e nvim
that gives trouble, even doing something like st -e sleep 2; nvim
doesn't output an error, so it's something specific. It may be to do with neovim 7.0 having been released?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.