Re: [dev] [PATCH] [st] Use inverted defaultbg/fg for selection when bg/fg are the same

2014-10-27 Thread Martti Kühne
in config.h something along the lines of enum color_mode { REVERSE, COLOR, }; struct selection_colors { enum color_mode; int colors[]; } static const struct selection_colors same = { .color_mode = COLOR, .colors = { 7, 0 } }; static const struct selection_colors different = { .color_mode =

Re: [dev] [PATCH] [st] Use inverted defaultbg/fg for selection when bg/fg are the same

2014-10-27 Thread Martti Kühne
in config.h something along the lines of enum { } color_mode; struct { } static const int select_same[2] = { 7, 0 }; static const int select_different[2] = { REVERSE, REVERSE }; or any pair of ints

Re: [dev] [dvtm] Truecolor support

2014-10-27 Thread k0ga
Hi, >> >> There is no support for true color in terminfo, so curses cannot >> handle it. > > Is this a fundamental limitation or just a lack of standardization? > > https://lists.gnu.org/archive/html/bug-ncurses/2013-10/msg7.html Mainly lack of standardization (this feature was added to

Re: [dev] [PATCH] [st] Use inverted defaultbg/fg for selection when bg/fg are the same

2014-10-27 Thread Brandon Mulcahy
On Sun, Oct 26, 2014 at 11:01:24PM -0300, dequis wrote: > This patch allows that text to be read by selecting it, turning it into > text with white bg and black fg (given default values for defaultbg/fg), > just like most normal unformatted text when selected. > --- > st.c | 11 --- > 1 fi

Re: [dev] [dvtm] Truecolor support

2014-10-27 Thread k0ga
> A simpler possibility is to let it enabled by default and let the user > switch it off with a command line argument (like it's done for the mouse > grabbing). I think it would make sense as all major terminal emulators > support true color. We have something similar for alternate screen to,

Re: [dev] [PATCH] [st] Fix issues with wcwidth() returning -1 for

2014-10-27 Thread Dmitrij D. Czarkoff
FRIGN said: > >> DESCRIPTION > >> The wcwidth() function returns the number of columns needed to > >> represent the wide character c. If c is a printable wide > >> character, the value is at least 0. If c > >> is null wide character (L'\0'), the value is 0. Otherwise -1

Re: [dev] [dvtm] Truecolor support

2014-10-27 Thread Marc André Tanner
On Mon, Oct 27, 2014 at 02:11:49PM +0100, k...@shike2.com wrote: > Hi, > > > Apparently curses provides: > > > > int init_color(short color, short r, short g, short b); > > > > not quite sure what it does internally. > > There is no support for true color in terminfo, so curses cannot > handle

Re: [dev] [PATCH] [st] Use inverted defaultbg/fg for selection when bg/fg are the same

2014-10-27 Thread dequis
On 27 October 2014 11:54, Martti Kühne wrote: > On Mon, Oct 27, 2014 at 3:01 AM, dequis wrote: >> The background/foreground of selected text is currently set by setting >> ATTR_REVERSE, which flips its normal bg/fg. When the text being >> selected has the same bg and fg, it won't be readable afte

Re: [dev] [dvtm] Truecolor support

2014-10-27 Thread Paride Legovini
On 2014-10-27 21:11, k...@shike2.com wrote: Hi, Apparently curses provides: int init_color(short color, short r, short g, short b); not quite sure what it does internally. There is no support for true color in terminfo, so curses cannot handle it. If your application need it the only way

Re: [dev] [PATCH] [st] Use inverted defaultbg/fg for selection when bg/fg are the same

2014-10-27 Thread random832
On Mon, Oct 27, 2014, at 10:54, Martti Kühne wrote: > This may sound trivial, but. > How about you paste it somewhere else? Requires having another window already open that can accept arbitrary text (and not attempt to execute it as commands).

Re: [dev] [PATCH] [st] Use inverted defaultbg/fg for selection when bg/fg are the same

2014-10-27 Thread Martti Kühne
On Mon, Oct 27, 2014 at 3:01 AM, dequis wrote: > The background/foreground of selected text is currently set by setting > ATTR_REVERSE, which flips its normal bg/fg. When the text being > selected has the same bg and fg, it won't be readable after selecting > it, either. > This may sound trivial

Re: [dev] [PATCH] [st] Use inverted defaultbg/fg for selection when bg/fg are the same

2014-10-27 Thread random832
On Mon, Oct 27, 2014, at 08:20, FRIGN wrote: > There's simply no reason to break consistency for some quirky irc-gag. But there's no compelling reason in the first place to visualize selection by inverting the colors. If you want "consistency" it can be achieved by having an actual selection color

Re: [dev] [dvtm] Truecolor support

2014-10-27 Thread Paride Legovini
On 2014-10-27 21:11, k...@shike2.com wrote: Hi, Apparently curses provides: int init_color(short color, short r, short g, short b); not quite sure what it does internally. There is no support for true color in terminfo, so curses cannot handle it. If your application need it the only way

Re: [dev] [PATCH] [st] Fix issues with wcwidth() returning -1 for

2014-10-27 Thread k0ga
> That's how POSIX-2001 defines it. > > So yeah, using abs() to "catch" the invalid case is fine, but could be > refined even more. > Ok, it is true. We should catch this case, but I don't like the idea of the abs. I think the correct solution should be print the invalid character. Regards,

Re: [dev] [dvtm] Truecolor support

2014-10-27 Thread k0ga
Hi, > Apparently curses provides: > > int init_color(short color, short r, short g, short b); > > not quite sure what it does internally. There is no support for true color in terminfo, so curses cannot handle it. If your application need it the only way is to print directly the sequences, and

Re: [dev] [PATCH] [st] Fix issues with wcwidth() returning -1 for

2014-10-27 Thread FRIGN
On Mon, 27 Oct 2014 13:03:49 +0100 Marc André Tanner wrote: > POSIX states for int wcwidth(wchar_t wc): "... or return -1 (if wc > does not correspond to a printable wide-character code)." Therefore > I think a return value of -1 should be handled gracefully. I have to agree here, even though I

Re: [dev] [dvtm] Truecolor support

2014-10-27 Thread Marc André Tanner
On Mon, Oct 27, 2014 at 03:26:44AM +0800, Paride Legovini wrote: > Hi, > > I see that st nicely support "truecolor" sequences, as it can be > easily tested with this command: > > printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n" > > that has to be given outside any terminal multiplexer. The point

Re: [dev] [PATCH] [st] Use inverted defaultbg/fg for selection when bg/fg are the same

2014-10-27 Thread FRIGN
On Sun, 26 Oct 2014 23:01:24 -0300 dequis wrote: > The background/foreground of selected text is currently set by setting > ATTR_REVERSE, which flips its normal bg/fg. When the text being > selected has the same bg and fg, it won't be readable after selecting > it, either. > > This may sound sil

Re: [dev] [PATCH] [st] Fix issues with wcwidth() returning -1 for

2014-10-27 Thread Marc André Tanner
On Mon, Oct 27, 2014 at 08:21:52AM +0100, k...@shike2.com wrote: > > On 26 October 2014 19:36, Dmitrij D. Czarkoff wrote: > >> Apparently no workaround is needed - just use sane libc or avoid using > >> new codepoints until glibc fixes that. Or, if you won't feel dirty > >> after that, send a pat

[dev] Re: surf rewrite for WebKit2GTK

2014-10-27 Thread Quentin Rameau
I fixed a few bugs, tell me if it works for you. On Thu, Oct 23, 2014 at 1:54 PM, Quentin Rameau wrote: > Hi, I tried to port surf for the webkit2 (WebKitGTK 2.6 / GTK3), here > is the code: > git://quinq.eu.org/surf2 > There will be some bugs, feel free to try it, feedback welcomed.

Re: [dev] [PATCH] [st] Fix issues with wcwidth() returning -1 for

2014-10-27 Thread k0ga
> On 26 October 2014 19:36, Dmitrij D. Czarkoff wrote: >> Apparently no workaround is needed - just use sane libc or avoid using >> new codepoints until glibc fixes that. Or, if you won't feel dirty >> after that, send a patch to glibc instead. > > 'Just using musl' doesn't seem feasible given a