Re: [dwm] [ANNOUNCE] dvtm-0.2

From: Christian Garbs <mitch_AT_cgarbs.de>
Date: Tue, 8 Jan 2008 20:45:58 +0100

On Sun, Dec 30, 2007 at 05:48:19PM +0100, Marc Andre Tanner wrote:
> On Sun, Dec 30, 2007 at 05:19:20PM +0100, y i y u s wrote:

> > And a suggestion: if the default modifier is CTRL+g there should
> > be a keybinding to send a CTRL+g to the client. This way you can
> > have nested dvtms. I will probably write a patch for it, but dunno
> > when it will happen.
 
> You could use the -m command line option which sets the modifier at
> runtime. So for example dvtm -m ^w will set it to CTRL+w. But i
> agree that there should also be the possibility to send CTRL+g.

I'd also need a way to send CTRL+s. My terminal reacts to the
combination and I don't know a way to escape it. Under screen,
I can use ^as instead.

The following patch enables escaped keystrokes. ^s works fine.
When I run a dvtm inside a dvtm, ^g works as well, but the inner
dvtm only displays garbled borders.

Regards,
Christian

---
 config.h |    2 ++
 dvtm.c   |   12 ++++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/config.h b/config.h
index e5d0774..3fcb4a7 100644
--- a/config.h
+++ b/config.h
@@ -82,6 +82,8 @@ Key keys[] = {
 	{ MOD, '7', focusn, "7" },
 	{ MOD, '8', focusn, "8" },
 	{ MOD, '9', focusn, "9" },
+	{ MOD, 'G', escapekey, "g" },
+	{ MOD, 'S', escapekey, "s" },
 };
 
 /* possible values for the mouse buttons are listed below:
diff --git a/dvtm.c b/dvtm.c
index f782b2b..4520c37 100644
--- a/dvtm.c
+++ b/dvtm.c
@@ -101,6 +101,7 @@ void togglebar(const char *arg);
 void setmwfact(const char *arg);
 void setlayout(const char *arg);
 void zoom(const char *arg);
+void escapekey(const char *arg);
 /* special mouse related commands */
 void mouse_focus(const char *arg);
 void mouse_fullscreen(const char *arg);
@@ -493,6 +494,17 @@ drawbar(){
 }
 
 void
+escapekey(const char *arg){
+	if (strlen(arg)) {
+		if(sel && (!sel->minimized || isarrange(fullscreen))){
+			madtty_keypress(sel->term, CTRL(arg[0]));
+			draw_content(sel);
+			wrefresh(sel->window);
+		}
+	}
+}
+
+void
 killclient(const char *arg){
 	if(!sel)
 		return;
-- 
1.5.3.7
Received on Tue Jan 08 2008 - 20:46:16 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:15:08 UTC