Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

From: Hiltjo Posthuma <>
Date: Tue, 1 Mar 2022 14:15:03 +0100

On Mon, Feb 28, 2022 at 09:27:22PM -0600, Dave Blanchard wrote:
> Hello all,

Hi David,

> This patch for 'st' causes CTRL+HOME to send the ANSI sequence \033[J and \033[1;5H , which signals the user program to scroll to the top of the document, same as in Xterm.
> I have absolutely no idea what the 'appkey' and 'appcursor' fields do, as there are almost no comments anywhere to be found in the source code, and I haven't yet reverse engineered the code enough to figure out what the hell it's actually doing with those values. The provided values seem to work fine, though they may need to be changed if they're wrong.

It makes sense to me to add \033[1;5H. I'm not sure if \033[J is correct, it
seems duplicate with XK_Home and XK_End also. Please test it properly.

On a note the cursor keys in st don't seem consistent either with xterm.

> On that note, regrettably it will be necessary for me to fork this project, if for no other reason than to properly comment it, so that its functionality can be understood and easily modified. It's a shame that such a nice little program is marred by its total lack of commentation, along with poorly chosen function and variable names. The use of tabs in the source code isn't particularly desirable either, IMO.

Negative bikeshed comments and exagerations ("total lack of comments") don't
help in making the project better.

> Overall, I like the 'suckless' initiative. I'm sick of all the bloat in the Linux world. My distro is built to be light weight, simple, and fast. 'st' is proving to be a nice addition, and a good starting point for building something even better. Looking forward to integrating more of your code into my system as I spend more time exploring your different projects, and the useful patches you've provided. Thanks for your work.
> --
> Dave Blanchard <>

I'd happily apply a general patch which improves in making the appkey and
cursorkey sequences more consistent.


Kind regards,
Received on Tue Mar 01 2022 - 14:15:03 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 01 2022 - 14:24:38 CET