[dev] New patches for st

2012-09-03 Thread Roberto E. Vargas Caballero
Hello,

Some new patches for st:

0001-Add-initialization-strings-in-terminfo.patch

Some new terminfo capabilities which help running reset.

0001-Add-write-I-O-to-file.patch

Add a theorical feature listed in st goals.

0001-Force-redisplay-of-all-lines-in-DECSCNM.patch

Add full redraw of the window in DECSCNM (reverse mode).

Best regards,
From 36550dccb6776a67d25b8af3cbfa87407fb5364b Mon Sep 17 00:00:00 2001
From: Roberto E. Vargas Caballero k...@shike2.com
Date: Mon, 3 Sep 2012 18:50:52 +0200
Subject: [PATCH] Add initialization strings in terminfo

When tput init is executed the list of task performed are (taken from
terminfo(5)):

  run the program
 iprog

  output is1 is2

  set the margins using
 mgc, smgl and smgr

  set tabs using
 tbc and hts

  print the file
 if

  and finally
 output is3.

When reset is executed, a more stronger initialization process is performed,
so the terminal can return from an unknown state. rs1, rs2 and rs3 are used
in this case instead of
using is1, is2 and is3.

This patch makes is2 = rs2, resets insert mode and set normal keypad
mode. For rs1 it performs a full initilization using ^[c.
---
 st.info |3 +++
 1 file changed, 3 insertions(+)

diff --git a/st.info b/st.info
index e883319..20e3f57 100644
--- a/st.info
+++ b/st.info
@@ -46,6 +46,7 @@ st| simpleterm,
 	ind=^J,
 	indn=\E[%p1%dS,
 	invis=\E[8m,
+	is2=\E[4l\E,
 	it#8,
 	kbs=\177,
 	kcub1=\E[D,
@@ -82,6 +83,8 @@ st| simpleterm,
 	op=\E[39;49m,
 	pairs#64,
 	rc=\E8,
+rs1=\Ec,
+rs2=\E[4l\E,
 	rev=\E[7m,
 	ri=\EM,
 	rmacs=\E(B,
-- 
1.7.10.4

From 91dbb5a8892b4b672722c9044316a0611683c777 Mon Sep 17 00:00:00 2001
From: Roberto E. Vargas Caballero k...@shike2.com
Date: Mon, 3 Sep 2012 18:47:54 +0200
Subject: [PATCH] Add write I/O to file

This is a theorical feature listed in http://st.suckless.org/goals. All the
input/output of the terminal will be written to a file, which can be very
useful for debugging, and also allow interconnect st to other process
through named pipes.
---
 st.1 |6 ++
 st.c |   14 +-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/st.1 b/st.1
index b6c119f..931b481 100644
--- a/st.1
+++ b/st.1
@@ -10,6 +10,8 @@ st \- simple terminal
 .RB [ \-w 
 .IR windowid ]
 .RB [ \-v ]
+.RB [ \-f
+.IR file ]
 .RB [ \-e
 .IR command ...]
 .SH DESCRIPTION
@@ -30,6 +32,10 @@ embeds st within the window identified by
 .B \-v
 prints version information to stderr, then exits.
 .TP
+.BI \-f  file
+writes all the I/O to
+.I file
+.TP
 .BI \-e  program  [  arguments  ... ]
 st executes
 .I program
diff --git a/st.c b/st.c
index bd230a3..fde0493 100644
--- a/st.c
+++ b/st.c
@@ -36,7 +36,7 @@
 
 #define USAGE \
 	st  VERSION  (c) 2010-2012 st engineers\n \
-	usage: st [-t title] [-c class] [-w windowid] [-v] [-e command...]\n
+	usage: st [-t title] [-c class] [-w windowid] [-v] [-f file] [-e command...]\n
 
 /* XEMBED messages */
 #define XEMBED_FOCUS_IN  4
@@ -342,7 +342,9 @@ static STREscape strescseq;
 static int cmdfd;
 static pid_t pid;
 static Selection sel;
+static FILE *fileio;
 static char **opt_cmd  = NULL;
+static char *opt_io= NULL;
 static char *opt_title = NULL;
 static char *opt_embed = NULL;
 static char *opt_class = NULL;
@@ -776,6 +778,10 @@ ttynew(void) {
 		close(s);
 		cmdfd = m;
 		signal(SIGCHLD, sigchld);
+		if (opt_io  !(fileio = fopen(opt_io, w))) {
+			fprintf(stderr, Error opening %s:%s,
+opt_io, strerror(errno));
+		}
 	}
 }
 
@@ -1534,6 +1540,9 @@ tputtab(bool forward) {
 void
 tputc(char *c) {
 	char ascii = *c;
+
+	if (fileio)
+		putc(ascii, fileio);
 	if(term.esc  ESC_START) {
 		if(term.esc  ESC_CSI) {
 			csiescseq.buf[csiescseq.len++] = ascii;
@@ -2269,6 +2278,9 @@ main(int argc, char *argv[]) {
 		case 'w':
 			if(++i  argc) opt_embed = argv[i];
 			break;
+		case 'f':
+			if (++i  argc) opt_io = argv[i];
+			break;
 		case 'e':
 			/* eat every remaining arguments */
 			if(++i  argc) opt_cmd = argv[i];
-- 
1.7.10.4

From 7274e538601584d00617236193ad225e7b8e3f8d Mon Sep 17 00:00:00 2001
From: Roberto E. Vargas Caballero k...@shike2.com
Date: Mon, 3 Sep 2012 19:01:53 +0200
Subject: [PATCH] Force redisplay of all lines in DECSCNM

When it is called DECSCNM all lines become dirty, because it is necessary
redraw all lines for getting the new colors. It is easy see the problem
running 'echo ^[[?5h'.

In order to get a correct flash when running tput flash is necessary wait
after DECSCNM, until the changes are displayed, because in other case the
switch between reverse on/reverse off will be too much fast and nothing will
happen.
---
 st.c |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/st.c b/st.c
index fde0493..193db5e 100644
--- a/st.c
+++ b/st.c
@@ -54,6 +54,7 @@
 
 #define SELECT_TIMEOUT (20*1000) /* 20 

[dev][st] Issue using dvtm with ?

2012-09-03 Thread Julien Richefeu

Hello,

I am using both last git release dvtm with st on two different computer 
under debian testing up to date.


On some reason dvtm wotk like a charm on the first computer but have 
tricky behavior (bad display with repeted or missing characters while 
typing, colors are missing) on the second.


More, when I use dvtm with another terminal emulator (terminator , 
xterm, xfce terminal) on the second computer, dvtm works perfectly.


I investigate the issue (check for the version, dependencies, ...) 
without finding any clues.


Is someone has on idea on this one?

Best regards,

Julien RICHEFEU



Re: [dev][st] Issue using dvtm with ?

2012-09-03 Thread Martti Kühne
On Mon, Sep 3, 2012 at 9:00 PM, Julien Richefeu jice...@free.fr wrote:
 Hello,

 I am using both last git release dvtm with st on two different computer
 under debian testing up to date.

 On some reason dvtm wotk like a charm on the first computer but have tricky
 behavior (bad display with repeted or missing characters while typing,
 colors are missing) on the second.

 More, when I use dvtm with another terminal emulator (terminator , xterm,
 xfce terminal) on the second computer, dvtm works perfectly.

 I investigate the issue (check for the version, dependencies, ...) without
 finding any clues.

 Is someone has on idea on this one?


A couple of questions which you seem not to consider:
Do you have different LANG/encoding especially, TERM env or font?
Is st's version exactly the same on both or what versions are installed?
Does the same difference apply to other terminals eg. xterm?

cheers!
mar77i



Re: [dev][st] Issue using dvtm with ?

2012-09-03 Thread Martti Kühne
On Mon, Sep 3, 2012 at 9:46 PM, Martti Kühne mysat...@gmail.com wrote:
 On Mon, Sep 3, 2012 at 9:00 PM, Julien Richefeu jice...@free.fr wrote:
 Hello,

 I am using both last git release dvtm with st on two different computer
 under debian testing up to date.

 On some reason dvtm wotk like a charm on the first computer but have tricky
 behavior (bad display with repeted or missing characters while typing,
 colors are missing) on the second.

 More, when I use dvtm with another terminal emulator (terminator , xterm,
 xfce terminal) on the second computer, dvtm works perfectly.

 I investigate the issue (check for the version, dependencies, ...) without
 finding any clues.

 Is someone has on idea on this one?


 A couple of questions which you seem not to consider:
 Do you have different LANG/encoding especially, TERM env or font?
 Is st's version exactly the same on both or what versions are installed?
 Does the same difference apply to other terminals eg. xterm?

 cheers!
 mar77i

Taking a minute longer, yes st seems to be a different version.
What st version exactly is it that is bad?



Re: [dev][st] Issue using dvtm with ?

2012-09-03 Thread Julien Richefeu

Le 03/09/2012 21:48, Martti Kühne a écrit :

On Mon, Sep 3, 2012 at 9:46 PM, Martti Kühnemysat...@gmail.com  wrote:

On Mon, Sep 3, 2012 at 9:00 PM, Julien Richefeujice...@free.fr  wrote:

Hello,

I am using both last git release dvtm with st on two different computer
under debian testing up to date.

On some reason dvtm wotk like a charm on the first computer but have tricky
behavior (bad display with repeted or missing characters while typing,
colors are missing) on the second.

More, when I use dvtm with another terminal emulator (terminator , xterm,
xfce terminal) on the second computer, dvtm works perfectly.

I investigate the issue (check for the version, dependencies, ...) without
finding any clues.

Is someone has on idea on this one?


A couple of questions which you seem not to consider:
Do you have different LANG/encoding especially, TERM env or font?
Is st's version exactly the same on both or what versions are installed?
Does the same difference apply to other terminals eg. xterm?

cheers!
mar77i

Taking a minute longer, yes st seems to be a different version.
What st version exactly is it that is bad?


Hi Martti,

Yes you have right, some explanations are missing:
1/ dvtm work well with another terminal emulator (xterm or xfce 
terminal) on the same computer that has issue with st.
2/ on both computer (one that works with st and the other), language, 
font and shell configuration are the same.
3/ on both computer dvtm ans st configuration are the same and are the 
default one.
4/ the st version installed on both computer is the last git relase 
compiled on the computer (I do not try to copy binaries and execute it 
on the other computer, I will try it). The version is from commit 
beecb162e346c328db2a7ff1c0574352fe0ebebc.


Julien



Re: [dev][st] Issue using dvtm with ?

2012-09-03 Thread Christoph Lohmann
Greetings.

On Mon, 03 Sep 2012 23:11:22 +0200 Julien Richefeu jice...@free.fr wrote:
 4/ the st version installed on both computer is the last git relase 
 compiled on the computer (I do not try to copy binaries and execute it 
 on the other computer, I will try it). The version is from commit 
 beecb162e346c328db2a7ff1c0574352fe0ebebc.

Please  use  the  official  repository  for bug reports. There were some
changes in the hg repository.

When installing the st.info be sure to not have unwanted duplicated def‐
initions in your $HOME/.terminfo directory.


Sincerely,

Christoph




Re: [dev][st] Issue using dvtm with ?

2012-09-03 Thread Julien Richefeu

Le 03/09/2012 23:11, Christoph Lohmann a écrit :

Greetings.

On Mon, 03 Sep 2012 23:11:22 +0200 Julien Richefeujice...@free.fr  wrote:

4/ the st version installed on both computer is the last git relase
compiled on the computer (I do not try to copy binaries and execute it
on the other computer, I will try it). The version is from commit
beecb162e346c328db2a7ff1c0574352fe0ebebc.

Please  use  the  official  repository  for bug reports. There were some
changes in the hg repository.

When installing the st.info be sure to not have unwanted duplicated def‐
initions in your $HOME/.terminfo directory.


Sincerely,

Christoph



Hi Christoph,

Sorry to not use the correct repository for bug reports.
I have pulled last version of st on hg repository without any 
differences at all.
I precise that st works well without dvtm and that's only when i use 
dvtm with st that problems begin.


Best regards,

Julien




Re: [dev][st] Issue using dvtm with ?

2012-09-03 Thread Julien Richefeu

Le 03/09/2012 23:11, Christoph Lohmann a écrit :

Greetings.

On Mon, 03 Sep 2012 23:11:22 +0200 Julien Richefeujice...@free.fr  wrote:

4/ the st version installed on both computer is the last git relase
compiled on the computer (I do not try to copy binaries and execute it
on the other computer, I will try it). The version is from commit
beecb162e346c328db2a7ff1c0574352fe0ebebc.

Please  use  the  official  repository  for bug reports. There were some
changes in the hg repository.

When installing the st.info be sure to not have unwanted duplicated def‐
initions in your $HOME/.terminfo directory.


Sincerely,

Christoph



Hi all again,

OK, I just found a little(!) differences between the two debian 
installation on the two computer: the first one (the one with issue 
between st and dvtm) has been installed with i686 architecture and the 
second one with x86_64 architecture.


So maybe the issue comes from the 32bits version of compiled or 
libraries used as dependencies?


Sicerely,

Julien