[dev] [st][PATCH] Use XftFontMatch in place of FcFontMatch.

2016-05-09 Thread Mark Edgar
This change allows st to correctly render fonts given in point sizes, bringing its behavior in line with other software: dwm, dmenu, tabbed, etc: FC_DEBUG=1 st -f Terminus:size=10 -Mark From 9d5447b61340038499ad74f37e9d1b012d3c720e Mon Sep 17 00:00:00 2001 From: Mark Edgar Date: Sun, 8 May

[dev] [dvtm] [PATCH] Replace interpret_esc_xterm with interpret_osc.

2014-07-13 Thread Mark Edgar
The patch below fixes a bug where title changes are not recognized, e.g.: printf '\033];title\007' The missing parameter (before the semicolon) should be interpreted as 0. -Mark From 81dd1a32e065e797d2c13fbb5d6eb78b1ae4bd40 Mon Sep 17 00:00:00 2001 From: Mark Edgar Date: Sat,

[dev] Re: [dvtm] [PATCH] Fix redraw bug when show_border() changes.

2014-06-16 Thread Mark Edgar
longer appears. -Mark From 2a9e2ab8faf513be90c811743f3d9fce831ff101 Mon Sep 17 00:00:00 2001 From: Mark Edgar Date: Tue, 17 Jun 2014 00:44:47 +0200 Subject: [PATCH 2/2] Resize the vt if its has_title_line has changed, even if its dimensions have not. --- dvtm.c | 29

Re: [dev] [dvtm] [PATCH] Use ERR as the modifier for direct key bindings.

2014-06-14 Thread Mark Edgar
On Tue, Feb 11, 2014 at 3:38 PM, Marc André Tanner wrote: > However some people would like to hide all borders even when there > exist multiple windows. > > > http://superuser.com/questions/706148/remove-vertical-split-bar-of-gnu-screen-vacating-the-space-instead-of-hiding-it/709427 > > I perso

[dev] [dvtm] [PATCH] Fix redraw bug when show_border() changes.

2014-06-14 Thread Mark Edgar
d1c62b3b4ebecb66d08ee47cc521465d8d2c4fa3 Mon Sep 17 00:00:00 2001 From: Mark Edgar Date: Sat, 14 Jun 2014 20:38:25 +0200 Subject: [PATCH] The Vt must redraw when show_border() changes. --- vt.c | 8 1 file changed, 8 insertions(+) diff --git a/vt.c b/vt.c index 056e132..78f3571 100644 --- a

Re: [dev] [dvtm] [PATCH] Use ERR as the modifier for direct key bindings.

2014-02-05 Thread Mark Edgar
layouts to dvtm.c, but it would involve quite a bit more work. I've included it below, merged with the recent show_border() patch -- very nice, by the way! -Mark From ab69a39e38e70f1109c71eee8b4907a23e775908 Mon Sep 17 00:00:00 2001 From: Mark Edgar Date: Wed, 5 Feb 2014 22:57:29 +0100 Subj

[dev] [dvtm] [PATCH] Use ERR as the modifier for direct key bindings.

2014-01-09 Thread Mark Edgar
rwise mention in config.def.h how to make direct key bindings. -Mark From 050b87527d311869b8c59db59687fd9d44f0404a Mon Sep 17 00:00:00 2001 From: Mark Edgar Date: Wed, 1 Jan 2014 15:16:39 +0100 Subject: [PATCH 1/2] Use ERR instead of 0 for modifier-less keybindings. This allows C-space (NUL)

Re: [dev] [st] [PATCH] Fix F28 key definition.

2013-12-28 Thread Mark Edgar
On Wed, Dec 18, 2013 at 8:04 AM, Roberto E. Vargas Caballero wrote: > I'm going to apply these patches, except the last one, the patch about > designators > use. It is a big table, and having all the values help to understand it. How does having all the values help to understand a row? The reas

[dev] [st] [PATCH] Fix F28 key definition.

2013-12-15 Thread Mark Edgar
A patch to fix the F28 key definition. Also, a resend of my other patches to clean up config.h. -Mark From b4234a09fe4ccb88a73cab9c74b7e2cccbe2cfa6 Mon Sep 17 00:00:00 2001 From: Mark Edgar Date: Sun, 15 Dec 2013 16:45:51 +0100 Subject: [PATCH 1/4] Fix definition of F28 key

Re: [dev] [st] [patch] Ignore numlock (Mod2Mask) for button events too.

2013-10-29 Thread Mark Edgar
On Mon, Oct 28, 2013 at 7:27 PM, Roberto E. Vargas Caballero wrote: >> I have applied it, but I have mistook and the patch is in the repository >> with me as author Actually, it looks OK to me; I'm listed as the author in the repository. > git-format-patch is also good ;). That's what I used, I

[dev] [dvtm] [PATCH] Reduce terminal output / flicker.

2013-10-26 Thread Mark Edgar
I noticed dvtm sometimes has a bit of "flicker" and also produces more terminal output than is necessary. The first patch below changes refresh() calls to wnoutrefresh() to make all updates occur right before dvtm goes to sleep in select(). I've been using this for several weeks now and it seems to

Re: [dev] [st] [patch] Cleanup config.def.h, eliminate mappedkeys, simplify matching.

2013-10-20 Thread Mark Edgar
On Sun, Oct 20, 2013 at 9:51 AM, Roberto E. Vargas Caballero wrote: > I think this patch is correct, because XK_NO_MOD is 0, so if there is > some modifier then 'state == mask' will be false. After the simplification, > match is too short and does nothing, so I think it should be > merged into km

Re: [dev] [st] [patch] Cleanup config.def.h, eliminate mappedkeys, simplify matching.

2013-10-20 Thread Mark Edgar
On Sun, Oct 20, 2013 at 9:51 AM, Roberto E. Vargas Caballero wrote: > Please send atomic patches Sorry for the mess, I've broken these changes out now. > In this case the tab part is not correct, because we use > smart tabs in the project, tabs for indentation and spaces for > alignment. Yes, m

Re: [dev] [st] [patch] Cleanup config.def.h, eliminate mappedkeys, simplify matching.

2013-10-20 Thread Mark Edgar
On Sat, Oct 19, 2013 at 12:43 PM, Alexander S. wrote: > Why removing mappedkeys? Sure, there may be no visible regression, but > checking every keypress against key bindings seems unreasonable to me. On Sun, Oct 20, 2013 at 9:11 AM, Roberto E. Vargas Caballero wrote: > I don't like the actual so

[dev] [st] [patch] Cleanup config.def.h, eliminate mappedkeys, simplify matching.

2013-10-18 Thread Mark Edgar
A series of patches for consideration. The first patch is purely aesthetic: it cleans up column headings (comments) and internal tabs in the shortcuts/key/mshortcuts tables in config.def.h. It also renames the fields in Key to match the nicer names given in config.def.h. The second patch removes

[dev] [st] [patch] Ignore numlock (Mod2Mask) for button events too.

2013-10-18 Thread Mark Edgar
A bug presents if you try to add a button shortcut to mshortcuts using a mask, for example: { Button3, ShiftMask, "hi"}, The above does not work if Numlock (Mod2Mask) is on, which is unexpected. -Mark 0001-Ignore-numlock-Mod2Mask-for-button-events-too.patch Description: Binary data

Re: [dev] [dvtm] [PATCH] Support multiple parameters in set/reset mode sequences.

2013-10-08 Thread Mark Edgar
On Tue, Oct 8, 2013 at 6:14 PM, Marc André Tanner wrote: > but rs1 still contains \E>. Yes, I spotted that, but it doesn't hurt anything since dvtm ignores it. But having [sr]mkx and flash in the TERMINFO description might make applications believe that they were supported. Once someone adds keyp

[dev] [dvtm] [PATCH] Support multiple parameters in set/reset mode sequences.

2013-10-07 Thread Mark Edgar
A couple of patches. The first simply reformats dvtm.info to make diffs nice. The second adds support for multiple parameters in set/reset mode sequences. -Mark 0001-Place-capabilities-one-per-line-in-dvtm.info.patch Description: Binary data 0002-Support-multiple-set-reset-mode-params-e.g.-E-1

Re: [dev] Re: [st] [PATCH] Avoid buffer overflows in the case of key-mapped strings.

2013-10-07 Thread Mark Edgar
On Mon, Oct 7, 2013 at 9:17 PM, Roberto E. Vargas Caballero wrote: > mk->s is a string that are assigned in config.h, so I don't think we > should check aginst NULL, because the only way it becomes NULL is > a stupid user who put a NULL in it, and this case let to the luser > get a good BOM!

[dev] Re: [st] [PATCH] Avoid buffer overflows in the case of key-mapped strings.

2013-10-06 Thread Mark Edgar
On Sun, Oct 6, 2013 at 12:24 PM, Mark Edgar wrote: > Oh, and let's do the same for Mousekey while we're at it. Here's a patch file for that. This one has correct behavior in case the user neglects to initialize .s in a Mousekey entry. -Mark 0004-Avoid-buffer-overr

[dev] Re: [st] [PATCH] Avoid buffer overflows in the case of key-mapped strings.

2013-10-06 Thread Mark Edgar
Oh, and let's do the same for Mousekey while we're at it. -Mark Avoid buffer overrun in bpress(). Use correct type for Mousekey.b (XButtonEvent.button). --- a/st.c +++ b/st.c @@ -256,9 +256,9 @@ typedef struct { } XWindow; typedef struct { - int b; + uint b; uint mask; - char s[ESC_BU

[dev] Re: [st] [PATCH] Avoid buffer overflows in the case of key-mapped strings.

2013-10-05 Thread Mark Edgar
Oops, I realized after a pull that I tried to break style (by declaring a local not at the top of a function). I've corrected that and also rebased these three on the current head. -Mark 0001-Simplify-Mod1-logic-in-kpress-eliminating-locals-and.patch Description: Binary data 0003-New-ttys

[dev] Re: [st] [PATCH] Avoid buffer overflows in the case of key-mapped strings.

2013-10-05 Thread Mark Edgar
OK, I've split this change into three patches. The cumulative affect of these is: kpress() is now much more straightforward and has no memcpy() calls. selnotify() now supports MODE_ECHO. I couldn't remove the cast there however. A new ttysend() function replaces all ttywrite();techo() sequences.

[dev] Re: [st] [PATCH] Avoid buffer overflows in the case of key-mapped strings.

2013-10-02 Thread Mark Edgar
On Tue, 1 Oct 2013 23:04:16 +0200, Roberto E. Vargas Caballero wrote: > I agree here, good catch and good implementation. Could you send > a mail with the patch and a proper commit message? No problem! I think it might be a good idea to move ttywrite();if(MODE_ECHO)techo() into its own function.

[dev] Re: [st] [PATCH] Avoid buffer overflows in the case of key-mapped strings.

2013-10-01 Thread Mark Edgar
On Mon, 23 Sep 2013 10:06:13 +0200, Roberto E. Vargas Caballero wrote: > On Sat, Sep 21, 2013 at 03:41:01PM +0200, Mark Edgar wrote: > I don't agree here, because if you insert a escape sequence is not dificult > get more of 16 characters (for example a key combination which upd

[dev] [dvtm] [PATCH] close(c->pty) to stop leaks

2013-09-21 Thread Mark Edgar
I noticed that pty numbers are never recycled after closing each window. -Mark diff --git a/dvtm.c b/dvtm.c index bff057b..ae0c8f2 100644 --- a/dvtm.c +++ b/dvtm.c @@ -665,6 +665,7 @@ setup() { static void destroy(Client *c) { + close(c->pty); if (sel == c) f

[dev] [st] [PATCH] Avoid buffer overflows in the case of key-mapped strings.

2013-09-21 Thread Mark Edgar
This patch avoids a buffer overflow in kpress() if a key-mapped string longer than 31 characters is given in config.h. It also changes the maximum allowable key-mapped string length to a (likely) more reasonable 16. -Mark key-str.patch Description: Binary data

Re: [dev] [st] [bug?] black, defaultbg, and altscreen

2013-08-31 Thread Mark Edgar
FYI: I posted a patch which should fix this issue. http://lists.suckless.org/dev/1308/17540.html -Mark

[dev] [st] [patch] Correctly initialize altscreen when defaultbg is not 0.

2013-08-25 Thread Mark Edgar
The alternate screen is not properly initialized when st starts. To see this, set defaultbg in config.h to anything other than 0 (for example, swap defaultfg and defaultbg), and run: ./st -e sh -c 'tput smcup; read' You should see that the top-left 80x24 rectangle is black (or whatever colorname[

[dev] [dvtm][bug] Patch for insert-mode bug.

2013-06-03 Thread Mark Edgar
Hello. It took me quite a few hours to track this one down! --- 4ab5ed5/vt.c +++ vt.c @@ -1151,7 +1151,7 @@ static void put_wc(Vt *t, wchar_t wc) Cell *src = b->curs_row->cells + b->curs_col; Cell *dest = src + width; size_t l

[dev] Re: A small patch for sic.

2013-02-20 Thread Mark Edgar
Oh man, I found the same patch two years ago in my sent mail... :( -Mark

[dev] A small patch for sic.

2013-02-20 Thread Mark Edgar
diff --git a/util.c b/util.c index 26953d0..8afa58f 100644 --- a/util.c +++ b/util.c @@ -49,7 +49,7 @@ strlcpy(char *to, const char *from, int l) { static char * eat(char *s, int (*p)(int), int r) { - while(s != '\0' && p(*s) == r) + while(*s != '\0' && p(*s) == r) s+

Re: [dev] [st] a real (I think) feature request

2009-11-08 Thread Mark Edgar
On Mon, Nov 2, 2009 at 7:15 AM, Robert C Corsaro wrote: > It reminds me of your typical IRC client.  transcript above and one line of > command at the bottom. sirc's ssfe implements this in a standalone application: http://www.iagora.com/~espel/sirc/ssfe.c. One could even use it with ssh. :)

[dev] [ii] patch for stdio routines

2009-09-23 Thread Mark Edgar
OK, I'm fairly happy with this, except that so far I've only lightly tested it. Summary of changes: Move the getaddrinfo/socket/connect dance to dial(), replacing memset(&hints) with hints={0} Replace read(1)*n with fgets() Replace snprintf(), strlen(), write() with fprintf(), and corresponding s

Re: [dev] [sic]: patches for string handling

2009-09-23 Thread Mark Edgar
On Wed, Sep 23, 2009 at 3:27 PM, Anselm R Garbe wrote: > 2009/9/22 Mark Edgar : >> * Use strcmp() instead of strncmp() where appropriate > > Applied. You missed one of these because it was mixed in with the startswith() change (patch attached). >> I have more changes, inc

[dev] [sic]: patches for string handling

2009-09-22 Thread Mark Edgar
Here's a summary of the changes in this patch: * Fix buffer overrun when using strncpy() * Use startswith() macro instead strncmp() * Use strcmp() instead of strncmp() where appropriate * Use const char * where appropriate * Use size_t instead of unsigned int in readl(). The startswith() macro is