Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2013 00:28:33 +0900
From:      Norikatsu Shigemura <nork@FreeBSD.org>
To:        mdv@unsavoury.net, beech@FreeBSD.org
Cc:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/176786: [PATCH] Fix some problem on ports/irc/scrollz.
Message-ID:  <20130312002833.f1a788d5c903267bbf0c490d@FreeBSD.org>
In-Reply-To: <201303100427.r2A4RRIq034947@freefall.freebsd.org>
References:  <201303100427.r2A4RRIq034947@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--Multipart=_Tue__12_Mar_2013_00_28_33_+0900_L=Fp.2xXiLKnhVTO
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi mdv and beech.

On Sun, 10 Mar 2013 04:27:27 GMT
beech@freebsd.org wrote:
> Synopsis: [PATCH] Fix some problem on ports/irc/scrollz.
> Responsible-Changed-From-To: freebsd-ports-bugs->beech
> Responsible-Changed-By: beech
> Responsible-Changed-When: Sun Mar 10 04:26:52 UTC 2013
> Responsible-Changed-Why: 
> I'll take it
> http://www.freebsd.org/cgi/query-pr.cgi?pr=176786

I made two patches to support tmux terminal multiplexer.
Please apply my attached patches, too.

-- 
Norikatsu Shigemura <nork@FreeBSD.org>

--Multipart=_Tue__12_Mar_2013_00_28_33_+0900_L=Fp.2xXiLKnhVTO
Content-Type: text/plain;
 name="patch-include-screen.h"
Content-Disposition: attachment;
 filename="patch-include-screen.h"
Content-Transfer-Encoding: 7bit

--- include/screen.h.orig	2011-04-29 17:21:18.000000000 +0900
+++ include/screen.h	2013-03-11 23:30:07.063088471 +0900
@@ -47,6 +47,7 @@
 #define ST_NOTHING      -1
 #define ST_SCREEN       0
 #define ST_XTERM        1
+#define ST_TMUX         2
 
 /* This is here because it happens in so many places */
 #define curr_scr_win	current_screen->current_window

--Multipart=_Tue__12_Mar_2013_00_28_33_+0900_L=Fp.2xXiLKnhVTO
Content-Type: text/plain;
 name="patch-source-screen.c"
Content-Disposition: attachment;
 filename="patch-source-screen.c"
Content-Transfer-Encoding: 7bit

--- source/screen.c.orig	2011-04-29 17:21:18.000000000 +0900
+++ source/screen.c	2013-03-12 00:08:32.423090823 +0900
@@ -2416,6 +2416,10 @@
 	{
 		screen_type = ST_SCREEN;
 	}
+	else if (0 != getenv("TMUX"))
+	{
+		screen_type = ST_TMUX;
+	}
 	else if ((char *) 0 != (displayvar = getenv("DISPLAY")))
 	{
 		if ((char *) 0 == (termvar = getenv("TERM")))
@@ -2454,6 +2458,7 @@
 	say("Opening new %s...",
 		screen_type == ST_XTERM ?  "window" :
 		screen_type == ST_SCREEN ? "screen" :
+		screen_type == ST_TMUX ?   "tmux window" :
 					   "wound" );
 	snprintf(sock.sun_path, sizeof sock.sun_path, "/tmp/irc_%08d_%x", (int) pid, mycycle);
 	sock.sun_family = AF_UNIX;
@@ -2569,6 +2574,22 @@
 			args[i] = NULL;
 			execvp(xterm, args);
 		}
+		else if (screen_type == ST_TMUX)
+		{
+			char	*args[64],
+				*ss,
+				*t,
+				opts[BIG_BUFFER_SIZE];
+
+			Debug((3, "going to execvp screen wserv..."));
+			args[i++] = "tmux";
+			args[i++] = "new-window";
+			snprintf(opts, BIG_BUFFER_SIZE-1, "%s %s %s", WSERV_PATH, sockaddr->sun_path, error_sockaddr->sun_path);
+			args[i++] = opts;
+			Debug((3, "added: %s %s '%s'", args[i-3], args[i-2], args[i-1]));
+			args[i++] = NULL;
+			execvp("tmux", args);
+		}
 		perror("execve");
 		unlink(sockaddr->sun_path);
 		unlink(error_sockaddr->sun_path);

--Multipart=_Tue__12_Mar_2013_00_28_33_+0900_L=Fp.2xXiLKnhVTO--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130312002833.f1a788d5c903267bbf0c490d>