Re: [PATCH] More window status indicators

2012-12-17 Thread Scott Frazer
On Thu, Dec 13, 2012 at 9:57 AM, Nicholas Marriott
 wrote:
> On Thu, Dec 13, 2012 at 09:38:01AM -0500, Scott Frazer wrote:
>> On Wed, Dec 12, 2012 at 2:21 PM, Nicholas Marriott
>>  wrote:
>> > Hi
>> >
>> > You definitely shouldn't use C0 control codes for this, you should
>> > probably use DCS but with a different prefix instead of "tmux;" which is
>> > used for raw passthrough (look at input_dcs_dispatch).
>> >
>>
>> Yes, I thought that was probably not the best way to do it.  I don't know how
>> DCS works, but I'm sure Google will help.
>>
>> > However, I'm not sure we need code to do this at all. Can't you use a
>> > wrapper script that sets the colour/renames the window/etc? That's what
>> > I do for ssh.
>> >
>> > For example something like:
>>
>> [example snipped]
>>
>> I think that would work for the 'sticky' status that I want, but I would 
>> still
>> have to use the alert and monitor-content indicators for fail/pass which have
>> the limitations I mentioned before.  I'll work on the DCS method and post a
>> new patch.  I understand it will likely be rejected, but perhaps someone else
>> will find it useful.  I certainly do :)
>
> You could check the return code and set different names/colours on
> success or failure and bind a key to reset the window options, maybe not
> quite as quick as it automatically removing the state but it'd work :-).

I thought some more about your approach of using the command line, and while I
liked it I didn't want to manually remove the pass/fail status when I visited
a window.  So I created this patch which adds an 'attention' indication that
is higher priority than the regular colors/attributes, and gets automatically
removed when you go to the window.  Again it feels a bit hacky, but was a
simple way to do it.  I like it better than my first approach because you can
add colors/attributes any way you want for any number of things.

Scott

---
 options-table.c |   15 +++
 status.c|   12 
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/options-table.c b/options-table.c
index 8ce838a..1e2bde1 100644
--- a/options-table.c
+++ b/options-table.c
@@ -655,6 +655,21 @@ const struct options_table_entry window_options_table[] = {
  .default_num = 8
},

+   { .name = "window-status-attn-attr",
+ .type = OPTIONS_TABLE_ATTRIBUTES,
+ .default_num = 0
+   },
+
+   { .name = "window-status-attn-bg",
+ .type = OPTIONS_TABLE_COLOUR,
+ .default_num = 8
+   },
+
+   { .name = "window-status-attn-fg",
+ .type = OPTIONS_TABLE_COLOUR,
+ .default_num = 8
+   },
+
{ .name = "window-status-attr",
  .type = OPTIONS_TABLE_ATTRIBUTES,
  .default_num = 0
diff --git a/status.c b/status.c
index e841d80..9223401 100644
--- a/status.c
+++ b/status.c
@@ -692,6 +692,15 @@ status_print(
attr = options_get_number(oo, "window-status-attr");
if (attr != 0)
gc->attr = attr;
+   fg = options_get_number(oo, "window-status-attn-fg");
+   if (fg != 8)
+   colour_set_fg(gc, fg);
+   bg = options_get_number(oo, "window-status-attn-bg");
+   if (bg != 8)
+   colour_set_bg(gc, bg);
+   attr = options_get_number(oo, "window-status-attn-attr");
+   if (attr != 0)
+   gc->attr = attr;
fmt = options_get_string(oo, "window-status-format");
if (wl == s->curw) {
fg = options_get_number(oo, "window-status-current-fg");
@@ -704,6 +713,9 @@ status_print(
if (attr != 0)
gc->attr = attr;
fmt = options_get_string(oo, "window-status-current-format");
+   options_set_number(oo, "window-status-attn-fg", 8);
+   options_set_number(oo, "window-status-attn-bg", 8);
+   options_set_number(oo, "window-status-attn-attr", 0);
}

if (wl->flags & WINLINK_BELL) {
-- 
1.7.8

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


status bar variables

2012-12-17 Thread Mark Volkmann
I'm trying to understand the difference between #T and #W.
The PragProg tmux book says #T is the window title and #W is the window
name.
However, #T seems the same as #h for me. It displays the host name.

-- 
R. Mark Volkmann
Object Computing, Inc.
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: vertical split using join-pane and pane dividers characters.

2012-12-17 Thread Sinbad
i tried -v option, it doesn't work. this is how i am using it.
even with the below command, it always splits horizontally.

:join-pane -v -t 1 -s 2


On Mon, Dec 17, 2012 at 12:38 PM, Thomas Adam  wrote:

> Hi,
>
> On 17 December 2012 06:46, Sinbad  wrote:
> > i have two windows in a tmux session, 1 and 2;
> > now i want to move the two windows to a single
> > pane, i am using join-pane -t 1 -s 2, when i
> > do this i get the horizontal split with the
> > top window containing the window 1 and bottom
> > window containing window 2, but instead of that
> > i need the window to be split vertically.
>
> This is what the '-v' option to joinp does.
>
> -- Thomas Adam
>
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: vertical split using join-pane and pane dividers characters.

2012-12-17 Thread Thomas Adam
Hi,

On 18 December 2012 06:23, Sinbad  wrote:
> i tried -v option, it doesn't work. this is how i am using it.
> even with the below command, it always splits horizontally.
>
> :join-pane -v -t 1 -s 2

It does work.  What is it what's not working for you, or more likely,
what is it you think it's supposed to do and isn't which is what
you're really trying to ask for?

-- Thomas Adam

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users