Re: problem with new-window and current directory

2014-02-28 Thread Matteo Cavalleri
it doesn't work, the new shell still opens on /




On Fri, Feb 28, 2014 at 8:02 AM, Nicholas Marriott <
nicholas.marri...@gmail.com> wrote:

> I think there might be pane_start_path as well which would work for you.
>
>
>
>  Original message 
> From: Matteo Cavalleri 
> Date: 27/02/2014 22:28 (GMT+00:00)
> To: Nicholas Marriott 
> Cc: tmux-users@lists.sourceforge.net
> Subject: Re: problem with new-window and current directory
>
>
> well, from my point of view (and the way i usually work) that won't be a
> problem at all, and in any case I think it would still better the be back
> at "/the/dir/I/was/in/before/running/whatever" rather than being put on "/"
> and then having to manually cd back to the correct dir
>
> anyway I understand other people might think different, but I suppose that
> it could still be configurable, e.g.
>
> bind-key c new-window -c '#{pane_current_path} -> current behavior
> bind-key c new-window -c '#{$PWD} -> suggested behavior
>
> or maybe fallback to $PWD if the process directory is empty (not sure if
> Thomas Adam meant that when he talked about subshells)
>
>
>
> > But what if the process changes the directory? We can tell the pwd where
> > we start the command but not if it changes it.
> >
> >
> > On Thu, Feb 27, 2014 at 11:14:42PM +0100, Matteo Cavalleri wrote:
> >> too bad :( just curious: why not e.g. evaluate $PWD when executing the
> command? it seems to be expanded just when the config is loaded and then
> the value is kept as is.
> >>
> >>
> >>
> >>> The mechanism is not always reliable, not sure there is much we can do
> about it.
> >>>
> >>>
> >>>  Original message 
> >>> From: Matteo Cavalleri 
> >>> Date: 27/02/2014 21:09 (GMT+00:00)
> >>> To: tmux-users@lists.sourceforge.net
> >>> Subject: problem with new-window and current directory
> >>>
> >>>
> >>> Hi, i?m using tmux 1.9a on osx and I have the following problem when i
> create a new window.
> >>>
> >>> in my .tmux.config:
> >>>
> >>> bind-key c new-window -c '#{pane_current_path}?
> >>>
> >>> steps to reproduce the problem
> >>>
> >>> $ cd
> >>> $ tmux
> >>> $ cd /usr/local
> >>>
> >>> C-b c -> creates a new window in /usr/local
> >>>
> >>> $ exit # closes the new window and go back to the first one
> >>> $ less /etc/hosts
> >>>
> >>> C-b c -> creates a new window in /usr/local
> >>>
> >>> $ exit
> >>> $ cat /etc/hosts | less # the pipe is important here
> >>>
> >>>
>
--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: problem with new-window and current directory

2014-02-28 Thread Matteo Cavalleri
btw I just discovered that with pane_start_path the new window opens on /
even if I'm just at the shell prompt




On Fri, Feb 28, 2014 at 9:53 AM, Matteo Cavalleri wrote:

> it doesn't work, the new shell still opens on /
>
>
>
>
> On Fri, Feb 28, 2014 at 8:02 AM, Nicholas Marriott <
> nicholas.marri...@gmail.com> wrote:
>
>> I think there might be pane_start_path as well which would work for you.
>>
>>
>>
>>  Original message 
>> From: Matteo Cavalleri 
>> Date: 27/02/2014 22:28 (GMT+00:00)
>> To: Nicholas Marriott 
>> Cc: tmux-users@lists.sourceforge.net
>> Subject: Re: problem with new-window and current directory
>>
>>
>> well, from my point of view (and the way i usually work) that won't be a
>> problem at all, and in any case I think it would still better the be back
>> at "/the/dir/I/was/in/before/running/whatever" rather than being put on "/"
>> and then having to manually cd back to the correct dir
>>
>> anyway I understand other people might think different, but I suppose
>> that it could still be configurable, e.g.
>>
>> bind-key c new-window -c '#{pane_current_path} -> current behavior
>> bind-key c new-window -c '#{$PWD} -> suggested behavior
>>
>> or maybe fallback to $PWD if the process directory is empty (not sure if
>> Thomas Adam meant that when he talked about subshells)
>>
>>
>>
>> > But what if the process changes the directory? We can tell the pwd where
>> > we start the command but not if it changes it.
>> >
>> >
>> > On Thu, Feb 27, 2014 at 11:14:42PM +0100, Matteo Cavalleri wrote:
>> >> too bad :( just curious: why not e.g. evaluate $PWD when executing the
>> command? it seems to be expanded just when the config is loaded and then
>> the value is kept as is.
>> >>
>> >>
>> >>
>> >>> The mechanism is not always reliable, not sure there is much we can
>> do about it.
>> >>>
>> >>>
>> >>>  Original message 
>> >>> From: Matteo Cavalleri 
>> >>> Date: 27/02/2014 21:09 (GMT+00:00)
>> >>> To: tmux-users@lists.sourceforge.net
>> >>> Subject: problem with new-window and current directory
>> >>>
>> >>>
>> >>> Hi, i?m using tmux 1.9a on osx and I have the following problem when
>> i create a new window.
>> >>>
>> >>> in my .tmux.config:
>> >>>
>> >>> bind-key c new-window -c '#{pane_current_path}?
>> >>>
>> >>> steps to reproduce the problem
>> >>>
>> >>> $ cd
>> >>> $ tmux
>> >>> $ cd /usr/local
>> >>>
>> >>> C-b c -> creates a new window in /usr/local
>> >>>
>> >>> $ exit # closes the new window and go back to the first one
>> >>> $ less /etc/hosts
>> >>>
>> >>> C-b c -> creates a new window in /usr/local
>> >>>
>> >>> $ exit
>> >>> $ cat /etc/hosts | less # the pipe is important here
>> >>>
>> >>>
>>
>
>
--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: problem with new-window and current directory

2014-02-28 Thread Nicholas Marriott
Well pane_start_path will always be where the pane started, but if it goes to / 
sounds like it isn't working. 

 Original message 
From: Matteo Cavalleri  
Date: 28/02/2014  08:54  (GMT+00:00) 
To: Nicholas Marriott  
Cc: tmux-users@lists.sourceforge.net 
Subject: Re: problem with new-window and current directory 
 
btw I just discovered that with pane_start_path the new window opens on /
even if I'm just at the shell prompt




On Fri, Feb 28, 2014 at 9:53 AM, Matteo Cavalleri wrote:

> it doesn't work, the new shell still opens on /
>
>
>
>
> On Fri, Feb 28, 2014 at 8:02 AM, Nicholas Marriott <
> nicholas.marri...@gmail.com> wrote:
>
>> I think there might be pane_start_path as well which would work for you.
>>
>>
>>
>>  Original message 
>> From: Matteo Cavalleri 
>> Date: 27/02/2014 22:28 (GMT+00:00)
>> To: Nicholas Marriott 
>> Cc: tmux-users@lists.sourceforge.net
>> Subject: Re: problem with new-window and current directory
>>
>>
>> well, from my point of view (and the way i usually work) that won't be a
>> problem at all, and in any case I think it would still better the be back
>> at "/the/dir/I/was/in/before/running/whatever" rather than being put on "/"
>> and then having to manually cd back to the correct dir
>>
>> anyway I understand other people might think different, but I suppose
>> that it could still be configurable, e.g.
>>
>> bind-key c new-window -c '#{pane_current_path} -> current behavior
>> bind-key c new-window -c '#{$PWD} -> suggested behavior
>>
>> or maybe fallback to $PWD if the process directory is empty (not sure if
>> Thomas Adam meant that when he talked about subshells)
>>
>>
>>
>> > But what if the process changes the directory? We can tell the pwd where
>> > we start the command but not if it changes it.
>> >
>> >
>> > On Thu, Feb 27, 2014 at 11:14:42PM +0100, Matteo Cavalleri wrote--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


[PATCH] typo in style_apply_update - fixes attrs in status bar

2014-02-28 Thread Stephen Thirlwall

Hi,

Since 1.9 my status bar hasn't been rendering correctly, and it looks
like there may have been a typo when factoring out style_apply_update
in this commit 945339b443affdaaca260605e15b5a3b9a3c6e16

status.c has a number of changes like this [1]:
-   fg = options_get_number(&s->options, "status-left-fg");
-   if (fg != 8)
-   colour_set_fg(gc, fg);
-   bg = options_get_number(&s->options, "status-left-bg");
-   if (bg != 8)
-   colour_set_bg(gc, bg);
-   attr = options_get_number(&s->options, "status-left-attr");
-   if (attr != 0)
-   gc->attr = attr;
+   style_apply_update(gc, &s->options, "status-left-style");

But style_apply_update() now looks like this [2]:
+   if (gcp->fg != 8)
+   colour_set_fg(gc, gcp->fg);
+   if (gcp->bg != 8)
+   colour_set_bg(gc, gcp->bg);
+   if (gcp->attr != 0)
+   gc->attr |= gcp->attr;

Note the final line where the new attributes are OR'ed in rather than set.

The attached example.config illustrates the problem.

In tmux 1.6/7/8 the status bar has the underscore attribute set, and the
current window has only bright.

In tmux 1.9, the current window has bright, but also underscore.

The attached patch restores the original rendering behaviour.

Steve

(github links because I can't work out how to reference individual lines in the 
sourceforge repo)
[1] 
https://github.com/ThomasAdam/tmux/commit/945339b443affdaaca260605e15b5a3b9a3c6e16#diff-89572738e5b52c0915a3d496b4d2f613L86
[2] 
https://github.com/ThomasAdam/tmux/commit/945339b443affdaaca260605e15b5a3b9a3c6e16#diff-bc9cdc3634a84e5dbe2350b4b180a7b2R211
diff --git a/style.c b/style.c
index 9974408..257d146 100644
--- a/style.c
+++ b/style.c
@@ -234,5 +234,5 @@ style_apply_update(struct grid_cell *gc, struct options 
*oo, const char *name)
colour_set_bg(gc, gcp->bg);
}
if (gcp->attr != 0)
-   gc->attr |= gcp->attr;
+   gc->attr = gcp->attr;
 }
set -g status-attr underscore
set -g window-status-current-attr bright
--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: [PATCH] typo in style_apply_update - fixes attrs in status bar

2014-02-28 Thread Nicholas Marriott
Apply is meant to replace, apply_update to add. So I think the function is 
right. More likely the call should be style_apply.

 Original message 
From: Stephen Thirlwall  
Date: 01/03/2014  00:28  (GMT+01:00) 
To: tmux-users@lists.sourceforge.net 
Subject: [PATCH] typo in style_apply_update - fixes attrs in status bar 
 
Hi,

Since 1.9 my status bar hasn't been rendering correctly, and it looks
like there may have been a typo when factoring out style_apply_update
in this commit 945339b443affdaaca260605e15b5a3b9a3c6e16

status.c has a number of changes like this [1]:
-   fg = options_get_number(&s->options, "status-left-fg");
-   if (fg != 8)
-colour_set_fg(gc, fg);
-   bg = options_get_number(&s->options, "status-left-bg");
-   if (bg != 8)
-colour_set_bg(gc, bg);
-   attr = options_get_number(&s->options, "status-left-attr");
-   if (attr != 0)
-gc->attr = attr;
+   style_apply_update(gc, &s->options, "status-left-style");

But style_apply_update() now looks like this [2]:
+   if (gcp->fg != 8)
+colour_set_fg(gc, gcp->fg);
+   if (gcp->bg != 8)
+colour_set_bg(gc, gcp->bg);
+   if (gcp->attr != 0)
+gc->attr |= gcp->attr;

Note the final line where the new attributes are OR'ed in rather than set.

The attached example.config illustrates the problem.

In tmux 1.6/7/8 the status bar has the underscore attribute set, and the
current window has only bright.

In tmux 1.9, the current window has bright, but also underscore.

The attached patch restores the original rendering behaviour.

Steve

(github links because I can't work out how to reference individual lines in the 
sourceforge repo)
[1] 
https://github.com/ThomasAdam/tmux/commit/945339b443affdaaca260605e15b5a3b9a3c6e16#diff-89572738e5b52c0915a3d496b4d2f613L86
[2] 
https://github.com/ThomasAdam/tmux/commit/945339b443affdaaca260605e15b5a3b9a3c6e16#diff-bc9cdc3634a84e5dbe2350b4b180a7b2R211

--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users
--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users