Re: Tmux 1.8 cored on Solaris while selecting in pane

2015-05-21 Thread Peter Schow
On Thu, May 21, 2015 at 10:47:15AM +0100, Nicholas Marriott wrote:
> Hi
> 
> IIRC this is a bug in Solaris libcurses. I think when we found it before
> someone reported it to whoever owned Solaris at the time and they said
> they weren't going to fix it.

Anyone have a bug number for this?

I maintain tmux for Solaris and will be glad to take a look.

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Regression with set-titles-string in 2.0?

2015-05-21 Thread Nicholas Marriott
On Thu, May 21, 2015 at 11:55:42AM +0100, Nicholas Marriott wrote:
> I think that all the status jobs stuff needs to be moved into formats,
> but it needs a bit of thinking.

Something like this:

Index: cmd-refresh-client.c
===
RCS file: /cvs/src/usr.bin/tmux/cmd-refresh-client.c,v
retrieving revision 1.13
diff -u -p -r1.13 cmd-refresh-client.c
--- cmd-refresh-client.c20 Oct 2014 22:29:25 -  1.13
+++ cmd-refresh-client.c21 May 2015 11:30:04 -
@@ -65,10 +65,9 @@ cmd_refresh_client_exec(struct cmd *self
}
if (tty_set_size(&c->tty, w, h))
recalculate_sizes();
-   } else if (args_has(args, 'S')) {
-   status_update_jobs(c);
+   } else if (args_has(args, 'S'))
server_status_client(c);
-   } else
+   else
server_redraw_client(c);
 
return (CMD_RETURN_NORMAL);
Index: format.c
===
RCS file: /cvs/src/usr.bin/tmux/format.c,v
retrieving revision 1.67
diff -u -p -r1.67 format.c
--- format.c20 May 2015 06:39:02 -  1.67
+++ format.c21 May 2015 11:30:04 -
@@ -35,6 +35,9 @@
  * string.
  */
 
+voidformat_job_callback(struct job *);
+const char *format_job_get(const char *);
+
 int format_replace(struct format_tree *, const char *, size_t, char **,
 size_t *, size_t *);
 char   *format_time_string(time_t);
@@ -46,6 +49,31 @@ void  format_defaults_client(struct form
 voidformat_defaults_winlink(struct format_tree *, struct session *,
 struct winlink *);
 
+/* Entry in format job tree. */
+struct format_job {
+   const char  *cmd;
+
+   time_t   last;
+   char*out;
+
+   struct job  *job;
+
+   RB_ENTRY(format_job) entry;
+};
+
+/* Format job tree. */
+intformat_job_cmp(struct format_job *, struct format_job *);
+RB_HEAD(format_job_tree, format_job) format_jobs = RB_INITIALIZER();
+RB_PROTOTYPE(format_job_tree, format_job, entry, format_job_cmp);
+RB_GENERATE(format_job_tree, format_job, entry, format_job_cmp);
+
+/* Format job tree comparison function. */
+int
+format_job_cmp(struct format_job *fj1, struct format_job *fj2)
+{
+   return (strcmp(fj1->cmd, fj2->cmd));
+}
+
 /* Entry in format tree. */
 struct format_entry {
char   *key;
@@ -54,22 +82,20 @@ struct format_entry {
RB_ENTRY(format_entry)  entry;
 };
 
-/* Tree of format entries. */
+/* Format entry tree. */
 struct format_tree {
struct window   *w;
struct session  *s;
 
-   RB_HEAD(format_rb_tree, format_entry) tree;
+   RB_HEAD(format_entry_tree, format_entry) tree;
 };
+intformat_entry_cmp(struct format_entry *, struct format_entry *);
+RB_PROTOTYPE(format_entry_tree, format_entry, entry, format_entry_cmp);
+RB_GENERATE(format_entry_tree, format_entry, entry, format_entry_cmp);
 
-/* Format key-value replacement entry. */
-intformat_cmp(struct format_entry *, struct format_entry *);
-RB_PROTOTYPE(format_rb_tree, format_entry, entry, format_cmp);
-RB_GENERATE(format_rb_tree, format_entry, entry, format_cmp);
-
-/* Format tree comparison function. */
+/* Format entry tree comparison function. */
 int
-format_cmp(struct format_entry *fe1, struct format_entry *fe2)
+format_entry_cmp(struct format_entry *fe1, struct format_entry *fe2)
 {
return (strcmp(fe1->key, fe2->key));
 }
@@ -134,6 +160,94 @@ const char *format_lower[] = {
NULL/* z */
 };
 
+/* Format job callback. */
+void
+format_job_callback(struct job *job)
+{
+   struct format_job   *fj = job->data;
+   char*line, *buf;
+   size_t   len;
+
+   fj->job = NULL;
+   free(fj->out);
+
+   if (!WIFEXITED(job->status) && WEXITSTATUS(job->status) != 0) {
+   xasprintf(&fj->out, "", fj->cmd,
+   WEXITSTATUS(job->status));
+   return;
+   }
+   if (WIFSIGNALED(job->status)) {
+   xasprintf(&fj->out, "", fj->cmd,
+   WTERMSIG(job->status));
+   return;
+   }
+
+   buf = NULL;
+   if ((line = evbuffer_readline(job->event->input)) == NULL) {
+   len = EVBUFFER_LENGTH(job->event->input);
+   buf = xmalloc(len + 1);
+   if (len != 0)
+   memcpy(buf, EVBUFFER_DATA(job->event->input), len);
+   buf[len] = '\0';
+   } else
+   buf = line;
+   fj->out = buf;
+}
+
+/* Find a job. */
+const char *
+format_job_get(const char *cmd)
+{
+   struct format_job   fj0, *fj;
+
+   fj0.cmd = cmd;
+   if ((fj = RB_FIND(format_job_tree, &format_jobs, &fj0)) == NULL)
+   {
+   fj = xcalloc(1, sizeof *fj);
+   fj->cmd = xstrdup(cmd);
+
+  

Re: Regression with set-titles-string in 2.0?

2015-05-21 Thread Nicholas Marriott
I think that all the status jobs stuff needs to be moved into formats,
but it needs a bit of thinking.

At the moment the jobs are run every status-interval with the
last two complete sets of output kept.

For formats it's a bit more fiddly because we could have many formats
coming from different places, some of them only used once.

I expect we probably want to do something vaguely similar but I'd say
have one cached set of outputs which is regularly cleaned of old entries
(every 5 minutes? 1 hour? 24 hours?). When a job is seen in a format, we
start it up and in the meantime use the value in the cache (or if it
isn't ready, something generic like ''. After it has
completed the first time, of course the old value will be ready (unless
it hasn't been run since the last clean).




On Sat, May 16, 2015 at 07:01:54PM +0100, Thomas Adam wrote:
> On Fri, May 15, 2015 at 09:52:06PM -0700, Lander Brandt wrote:
> > When upgrading from tmux 1.9a to 2.0, shell commands are no longer
> > executed in title strings. For example I have in my .tmux.conf:
> 
> Yes, it will be replaced eventually.
> 
> -- Thomas Adam
> 
> -- 
> "Deep in my heart I wish I was wrong.  But deep in my heart I know I am
> not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.)
> 
> --
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> ___
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Tmux 1.8 cored on Solaris while selecting in pane

2015-05-21 Thread Nicholas Marriott
Hi

IIRC this is a bug in Solaris libcurses. I think when we found it before
someone reported it to whoever owned Solaris at the time and they said
they weren't going to fix it.

I suggest you just turn off set-clipboard.


On Thu, May 21, 2015 at 10:06:28AM +0200, Martin ??eh??k wrote:
> Hello,
> 
> I got core while pressing enter to do a text selection in tmux 1.8 on Solaris.
> Here is the backtrace:
> 
> tmux@unix:~$ mdb tmux.core
> Loading modules: [ libc.so.1 ld.so.1 ]
> > $C
> fd8304fc0b51 tty_puts+4(91325052f0, 0, 10007a848, 913c60d090, bb6c, 0)
> fd8304fc0c01 tty_cmd_setselection+0x7c(91325052f0, fd8304fc1610, 
> 8c91, 913c60d090, aaab, 8c91)
> fd8304fc0cb1 tty_write+0x12c(100058d80, fd8304fc1610, 0, 10400, 
> 100212840, 10148)
> fd8304fc0d61 screen_write_setselection+0x48(fd8304fc1710, 913c6043f0, 
> 8c8f, 100058, 91305bdbc0, 913c90b850)
> fd8304fc0e61 window_copy_copy_buffer+0x48(91305bdbc0, , 
> 913c6043f0, 8c8f, 10007a, fd8304fc1710)
> fd8304fc0f21 window_copy_copy_selection+0x20(91305bdbc0, 
> , 10007a, 32, 32, 10005db10)
> fd8304fc0fe1 window_copy_key+0x9e0(91305bdbc0, 32, 9130579f20, 1, 
> 913c90b8c8, 913c90b850)
> fd8304fc1211 tty_keys_next+0x39c(913b88fef0, d, 1, 1, 1, d)
> fd8304fc12e1 tty_read_callback+4(9130cb2cb0, 913b88fef0, 9130cb2cb8, 34, 
> 0c00, 1)
> fd8304fc1391 libevent-1.4.so.2.2.0`bufferevent_readcb+0x1a0(9130cb2cb8, 
> 9130c90e10, 9130cb2cb0, 0, 7fc08a3d2, 
> 9130c90e10)
> fd8304fc1451 libevent-1.4.so.2.2.0`event_process_active+0xd8(913054bf00, 
> 9130cb2cb8, 9130545c20, 1b, 7fc08a3d2
> , 1)
> fd8304fc1511 libevent-1.4.so.2.2.0`event_base_loop+0x238(913054bf00, 
> 10624c00, 0, e94c5a2, 7fc08a3e0, 
> 7fc08a3e00a38)
> fd8304fc15f1 server_loop+0x40(0, 913057b3e0, 0, 1, 100202310, 100212840)
> fd8304fc16a1 server_start+0xb08(100212, 10, 100212000, 100212000, 
> 100212, 10004b000)
> fd8304fc1771 client_connect+0x16c(100212948, 4, 100069a80, 4, 100072c00, 
> fd8304fc2030)
> fd8304fc18a1 client_main+0x160(0, fd8304fc34d0, 0, 0, 100212000, 0)
> fd8304fc21c1 main+0xa70(9130545c20, 41c0, 100079, 100079000, 0, 
> fd8304fc379b)
> fd8304fc2c11 _start+0x17c(0, 0, 0, 0, 0, 0)
> > ::status
> debugging core file of tmux (64-bit) from unix
> file: /usr/bin/tmux
> initial argv: tmux
> threading model: native threads
> status: process terminated by SIGSEGV (Segmentation Fault), addr=0
> 
> ttu_puts() got 0 as a second argument. Let me know if you need more info for 
> debugging.
> 
> Thank you
> -- 
> Martin Rehak
> 
> --
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> ___
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Tmux 1.8 cored on Solaris while selecting in pane

2015-05-21 Thread Martin Řehák
Hello,

I got core while pressing enter to do a text selection in tmux 1.8 on Solaris.
Here is the backtrace:

tmux@unix:~$ mdb tmux.core
Loading modules: [ libc.so.1 ld.so.1 ]
> $C
fd8304fc0b51 tty_puts+4(91325052f0, 0, 10007a848, 913c60d090, bb6c, 0)
fd8304fc0c01 tty_cmd_setselection+0x7c(91325052f0, fd8304fc1610, 8c91, 
913c60d090, aaab, 8c91)
fd8304fc0cb1 tty_write+0x12c(100058d80, fd8304fc1610, 0, 10400, 
100212840, 10148)
fd8304fc0d61 screen_write_setselection+0x48(fd8304fc1710, 913c6043f0, 
8c8f, 100058, 91305bdbc0, 913c90b850)
fd8304fc0e61 window_copy_copy_buffer+0x48(91305bdbc0, , 
913c6043f0, 8c8f, 10007a, fd8304fc1710)
fd8304fc0f21 window_copy_copy_selection+0x20(91305bdbc0, , 
10007a, 32, 32, 10005db10)
fd8304fc0fe1 window_copy_key+0x9e0(91305bdbc0, 32, 9130579f20, 1, 
913c90b8c8, 913c90b850)
fd8304fc1211 tty_keys_next+0x39c(913b88fef0, d, 1, 1, 1, d)
fd8304fc12e1 tty_read_callback+4(9130cb2cb0, 913b88fef0, 9130cb2cb8, 34, 
0c00, 1)
fd8304fc1391 libevent-1.4.so.2.2.0`bufferevent_readcb+0x1a0(9130cb2cb8, 
9130c90e10, 9130cb2cb0, 0, 7fc08a3d2, 
9130c90e10)
fd8304fc1451 libevent-1.4.so.2.2.0`event_process_active+0xd8(913054bf00, 
9130cb2cb8, 9130545c20, 1b, 7fc08a3d2
, 1)
fd8304fc1511 libevent-1.4.so.2.2.0`event_base_loop+0x238(913054bf00, 
10624c00, 0, e94c5a2, 7fc08a3e0, 
7fc08a3e00a38)
fd8304fc15f1 server_loop+0x40(0, 913057b3e0, 0, 1, 100202310, 100212840)
fd8304fc16a1 server_start+0xb08(100212, 10, 100212000, 100212000, 
100212, 10004b000)
fd8304fc1771 client_connect+0x16c(100212948, 4, 100069a80, 4, 100072c00, 
fd8304fc2030)
fd8304fc18a1 client_main+0x160(0, fd8304fc34d0, 0, 0, 100212000, 0)
fd8304fc21c1 main+0xa70(9130545c20, 41c0, 100079, 100079000, 0, 
fd8304fc379b)
fd8304fc2c11 _start+0x17c(0, 0, 0, 0, 0, 0)
> ::status
debugging core file of tmux (64-bit) from unix
file: /usr/bin/tmux
initial argv: tmux
threading model: native threads
status: process terminated by SIGSEGV (Segmentation Fault), addr=0

ttu_puts() got 0 as a second argument. Let me know if you need more info for 
debugging.

Thank you
-- 
Martin Rehak

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users