Re: [dev] [st][patch] Fix segfault when pressing PrintScr without a selection

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Thu, 27 Mar 2014 07:47:51 +0100

> Attached is a silly patch to prevent a segmentation fault in st when
> you accidentally press PrintScr with no text selected.

Uysss, stupid bug I commited, thanks!!!!

> BTW does anybody use this with a plumber? Care to explain the details?

I don't use it with a plumber, but for example I have used it with
pipes for some concrete things:

        st | sed 's/^M//g' | mail -s "last diff" k0ga_AT_shike2.com

        inside st:
                ssh hal9000
                git diff
                [CTRL+PrintScr]
                [Enter]
                [CTRL+PrintScr]
                ^D

The most ugly part here is the extra ^M you get with selections. If you
want to use a real plumber you could check aginst regular expressions in a
case:

        #/bin/sh

        case $1 in
        http:*)
                surf $1
                ;;
        *.jpg)
                sxiv $1
                ;;
        esac


Of course, in the case of *.jpg it will work only if the selection is an
absolute name, or the plumber and st are in the same directory.

Regards,

        
-- 
Roberto E. Vargas Caballero
Received on Thu Mar 27 2014 - 07:47:51 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 27 2014 - 08:00:04 CET