Home | News | Download | Packages | Forum | Wiki | Github

[solved] St suckless terminal + patches + void repo

(Userx) #1

you have st in the repo, I installed st (suckless terminal) seeing it is way too basic I googled how tos and such. found this web page on patches for st to add functionality.

Is their an easy way to use them to add simple basic functionality like “scrollback” to the termial. Now that it is already installed using the repo. not from source.

if no, is thier a hope in hopeland that these patches will be added to the source code before compling or after, whichever way it needs to be done then added the new st terminal with added functionality into the repo so that this terminal has these basic (most people look for them items) already included into st (suckless terminal) without having to hassel in monkeying around to add them afterwords?

I’ve alread added delete key functionality finding how to on arch wiki adding the line set enable-keypad on to my .inputrc


You have to add the patches yourself and recompile it, we won’t add them to the repo.

(Userx) #3

so best to remove, and just use source if I want added fuctionality? maybe a redundent question.
oh darn I love the repo simple way of life … :frowning: thanks for your reply.


You could use the void-packages repo to compile it with your patches and create a local repo with it.
Patches in -p0 format can be added to srcpkgs/st/patches/.

(Userx) #5

projects … I’ve never gotten so far as to dig into how to and actually set up a xbps-src on my sys, and for just for one app that is a “just for something to do” chekcing it out situation. bcause I already have two terms I already use regulary. but thanks for that idea.


I can share my patched version wich includes alpha,clipboard,no-bold-colors,scrollback with mouse, for testing if it’s interesting…
and I would encurage the basic knowlege of building from templates, sorry for the morale speech:)

(Userx) #7

Ole to the Morale speeches… sure ok I’ll give it a spin but no basic knowleadge of using the templates haven’t dug into them because I have not had any really need to do so. everything I use is already in the repos ready for install and updated regularly. I only looked into st (suckless Term) because of someones desktop show off stating what they used and wondered what st was … just another too stripped back version of a terminal emulator, whereas you see even you and others have to patch it in order to get scrollback capibilites even. something every terminal emulator should have. eliminating use for less and more. then having to run it again just to go back over what one just read to review and confirm and others reasons to have to read it again.


@userxbw, there is actually another way to obtain scrollback functionality in st, without changing the source code at all.

All you need to do is run tmux/screen/dvtm. I use tmux with vanilla st from void repositories and I can scrollback as much as I want by pressing Ctrl-b [ PgUp/PgDown.

Just run st like this:
st -e tmux
and st will be started with tmux.


just felt like doing a quick guide on that moral speech…
(just wasting a little bit of time, course i just for the moment wanted to do some light work.)

#installing xbps-src
first you need git

# xbps-install -S git

then go to a prefered dir where you want the void-pakage tree to be installed.
I prefered /opt ( Optional application software packages ) since i dont feel that it really fitted anywhere else
clone the pakage repository and create the bootstrap environment.

# cd /opt
# git clone https://github.com/voidlinux/void-packages
# cd void-packages
# ./xbps-src binary-bootstrap

*Tip: usually, you must always be in this directory whenever you are using xbps-src, otherwise xbps-src wont find itself when it enters the building mode.(that means, it wont work even if you create a symbolik link to /bin)
But you can prevent this behave, by adding this dir to the PATH variable. then xbps-src will be able to execute where ever you are

**Tip to Tip: the PATH variable is found in “/etc/profile”. “profile” in turn has orders to execute all “*.sh” files in “/etc/profiles.d”. So as a safety occasion, we can keep PATH in /etc/profile intact and instead append our path thru a separate .sh file

# cd /etc/profiles.d
# echo PATH=$PATH":/opt/void-packages">>binarypaths.sh
# echo export PATH>>binarypaths.sh

#adding patches
the suckless-terminal (st) template will be found in "void-pakages/srcpkgs/st"
go there and create a new dir called patches

# cd /opt/void-packages/srcpkgs/st
# mkdir patches

*TIP: if you don’t want to convert all your patches to -p0 (those found on succless homepage are -p1), witch means to remove all the +++ and — from the file, you can switch the patching mode buy adding “patch_args=”-p1"" to the template.

# sed ‘/depends=“ncurses”/a patch_args="-p1"’ template

(the line above will append the line nicely after dependencys)

now just simply drop what ever patches you like in to the patches dir and continue on building.
just make sure that the patch versions are the same as st

*(the line below asumes that you will use st0.7 witch is the current version)
**(a small note here is that this scroll back option failed at build for me. but other patches where installed this way, so i don’t think it is the method that is the week link)

# cd patches
# wget http://st.suckless.org/patches/st-scrollback-mouse-20160727-308bfbf.diff

#building stuff
just simply:

# xbps-src pkg st

if it all went well, your package can be found in “/opt/void-packages/hostdir/binpkgs”

add the pakagedir as a new local reprisitory

# cd /etc/xbps.d
# repository=/opt/void-packages/hostdir/binpkgs>>local-repo.conf
# chmod +x local-repo.conf

and install using xbps-install

# xbps-install -S st

also wanted to apologist to Duncan, xtream and biopsin for all my misunderstandings on these maters over the last year, that i didn’t understood at that time. i hope i didn’t forget about something…
oh! i do have a question, yes. Is there a good way to make xbps-install to prefer things in my local repo that maybe has older versions of stuff then the remote once?

(Userx) #10

Ended up with errors.
I added these patches to that patches directory


I go tthis error … Just saying :

st-0.7.tar.gz: 41KB [avg rate: 53KB/s]
=> st-0.7_1: verifying checksum for distfile ‘st-0.7.tar.gz’… OK.
=> st-0.7_1: running do-extract hook: 00-distfiles …
=> st-0.7_1: extracting distfile(s), please wait…
=> st-0.7_1: running post-extract hook: 00-patches …
=> st-0.7_1: patching: st-delkey-0.6.diff.
The text leading up to this was:

|diff --git a/config.def.h b/config.def.h
|index 64e75b8…0811af4 100644
|— a/config.def.h

+++ b/config.def.h

File to patch:
Skip this patch? [y]
2 out of 2 hunks ignored
The text leading up to this was:

|diff --git a/st.info b/st.info
|index 2acd8b2…21b4734 100644
|— a/st.info

+++ b/st.info

File to patch:
Skip this patch? [y]
2 out of 2 hunks ignored
=> ERROR: st-0.7_1: failed to run post-extract_00-patches() at line 34.
userx@voided/>>$ls /opt/void-packages/hostdir/binpkgs


St-delkey is to version 0.6 . It needs to be to be 0.7,
Removit or replace it with the right version…

Edit: Looks like you have the right version under it, so just delet it

(Userx) #12

Thanks for the use of your eye balls. :eyeglasses:

It is still not working it has to be the ver of patch no matter what I do suppose, because the repo st is ver .7_1 whereas the patch from what you’ve said, I have not looked yet, is ver .7 the _1 maybe the cause of the problem.

will this set up actually patch more then one at a time as well?

=> st-0.7_1: patching: st-scrollback-mouse-20160727-308bfbf.diff.
The text leading up to this was:

|diff --git a/config.def.h b/config.def.h
|index b41747f…5ab8d2e 100644
|— a/config.def.h

+++ b/config.def.h

File to patch:
Skip this patch? [y]
1 out of 1 hunk ignored
The text leading up to this was:

|diff --git a/st.c b/st.c
|index 2594c65…9744bcf 100644
|— a/st.c

+++ b/st.c

File to patch:
Skip this patch? [y]
3 out of 3 hunks ignored
=> ERROR: st-0.7_1: failed to run post-extract_00-patches() at line 34.

I did find a work around for the del key.

DEL-Key not working properly in some Application
add following to ~/.inputrc or /etc/inputrc:

set enable-keypad on


another question.

it is looking for msul repo that I do not use it fails , i know it is no really big deal but where is the config file to comment that order out to seek mscl repo. and should not it be written to check to see what OS it is and then only look in there if the OS is musl and visa versa non- musl OS and pull off of that one. as apposed to the just in case, look and try to pull from every repo even ones not really needed?

[*] Updating https://repo.voidlinux.eu/current/musl/x86_64-repodata' ... ERROR: [reposync] failed to fetch filehttps://repo.voidlinux.eu/current/musl/x86_64-repodata’: Not Found

One more Question, if you please.

now that I have the void-repo on my system via clone. do I and how do I update it? should I update it reguarly? I do suppose just issuing the commands to clown it using the same directory. or does it get updated everytime I run xbps-src pkg xxx?


You should update it manually. Probably every time there is a change to a template that you want to build or is a dependency of your package.

But hey why do you want to use st anyways.
Its really not made for everyone and only makes sense if you know what your are doing and you want to hack on its source.
Otherwise its just useless, it does the same as every other terminal emulator just with less features and no configuration files.

(Userx) #14

I don’t, as I left in my comments in here it was a whim of a thing because I seen someone was using something called st. so I just investagated it then did a lets just see what that looks like. then others read this post and them too being board added to it. then I seen this how to step by step so I said I got a few minutes let me try it, and well it’s giving me problems so now its got me into how do I fix that problem mode for a I don’t really need this app cycle … lol

excerpt from previos comment in here by me

just another too stripped back version of a terminal emulator, whereas
[as] you see even you and others have to patch it in order to get scrollback
capibilites even.

Though your question to me now begs my question to you, we both know it is a useless term (more then not) so why did you even bother putting it in here with it being in a state of not being able to do much yet. ?


st is not useless. It has one quality which no other terminal emulator has: it doesn’t suck :innocent:

Seriously though, st should be used in conjuction with a terminal multiplexer, as the authors suggest (see here: “do not reimplement tmux and his comrades” or the non-goal "unlimited scrollback buffer (done by dvtm [and tmux, and screen]).


Its completely useless for users who don’t wan’t to hack on it, give me one reason why it sucks less than e.g, urxvt for normal use cases.

(Userx) #17

oh you had to go there didn’t you using that word ~NORMAL~ didn’t ya?

ok usless may have been a little harsh as I am using it right now running a script in it… so yeah I’m using it. :blush:


Well, I would have to ask you what are “normal” use cases from your perspective.

Compared to urxvt for example, st is way faster on my machine. Startup is basically instantaneous. Since I spend lots of time at the CLI, even a fraction of a second is an improvement for me.
Also, I need to configure X resources in order to get the most out xterm/urxvt/etc. St on the other hand comes with sane defaults and the possibility to customize it from the command line (eg. to change font I can simply launch it like this st -f terminus.
Also, since I use tmux, tmux + urxvt/terminator/etc. is redundant, while tmux + st doesn’t have as much bloat.

All of the above of course is my opinion. St is perfect for people like me, and I’m okay with it not being for everyone.

(Userx) #19

i’m not really resource worried… Laptop 16GB ram i7 light playing around with blender running scripts, watching movies nothing worrisome.

  • the error you got on patch for scroll back:
    did you forget to add the


in the template?

  • how to update the source tree:
    you update using git. git has a loots of ways to do stuff depending on in witch way you want to do stuff… but you might do it like this

first go to void-pakages dir

# cd /opt/void-packages

init and create a new branch called “upstream” with the address to the remote void packages

# git init
# git remote add upstream https://github.com/voidlinux/void-packages.git

then update using the pull function to pull stuff from upstream to your master branch

# git pull upstream master

you will only need to repeat that last line if standing in the same folder next time you update :wink: