From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Mar 11 15:28:39 2013 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 17E60B4E; Mon, 11 Mar 2013 15:28:39 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (unknown [IPv6:2001:2f0:104:80a1::25]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC8CA6B; Mon, 11 Mar 2013 15:28:38 +0000 (UTC) Received: from pelsia (localhost [127.0.0.1]) by sakura.ninth-nine.com (8.14.4/8.14.4/NinthNine) with SMTP id r2BFSZ1D027307; Tue, 12 Mar 2013 00:28:36 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Tue, 12 Mar 2013 00:28:33 +0900 From: Norikatsu Shigemura To: mdv@unsavoury.net, beech@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> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Tue__12_Mar_2013_00_28_33_+0900_L=Fp.2xXiLKnhVTO" Cc: freebsd-ports-bugs@FreeBSD.org X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Mar 2013 15:28:39 -0000 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 --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--