Merge lp:~paparomeo/byobu/byobu into lp:byobu

Proposed by Pedro Romano
Status: Merged
Merged at revision: 2378
Proposed branch: lp:~paparomeo/byobu/byobu
Merge into: lp:byobu
Diff against target: 24 lines (+4/-3)
1 file modified
usr/lib/byobu/include/select-session.py (+4/-3)
To merge this branch: bzr merge lp:~paparomeo/byobu/byobu
Reviewer Review Type Date Requested Status
Dustin Kirkland  Pending
Review via email: mp+221614@code.launchpad.net

Description of the change

This branch adds named sessions starting with an underscore also as hidden sessions in alternative to named sessions starting with a dot, since tmux doesn't support session names starting with a dot. In the process it also adds support for hidden session in tmux if the session names start with an underscore, adding this feature to tmux based byobu.

To post a comment you must log in.
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Brilliant, thanks for this. Merge committed. Will release soon.

Cheers!

:-Dustin

On Sat, May 31, 2014 at 4:20 PM, Pedro Romano
<email address hidden> wrote:
> Pedro Romano has proposed merging lp:~pmcnr/byobu/byobu into lp:byobu.
>
> Requested reviews:
> Dustin Kirkland  (kirkland)
>
> For more details, see:
> https://code.launchpad.net/~pmcnr/byobu/byobu/+merge/221614
>
> This branch adds named sessions starting with an underscore also as hidden sessions in alternative to named sessions starting with a dot, since tmux doesn't support session names starting with a dot. In the process it also adds support for hidden session in tmux if the session names start with an underscore, adding this feature to tmux based byobu.
> --
> https://code.launchpad.net/~pmcnr/byobu/byobu/+merge/221614
> You are requested to review the proposed merge of lp:~pmcnr/byobu/byobu into lp:byobu.
>
> === modified file 'usr/lib/byobu/include/select-session.py'
> --- usr/lib/byobu/include/select-session.py 2014-03-17 01:32:43 +0000
> +++ usr/lib/byobu/include/select-session.py 2014-05-31 14:19:17 +0000
> @@ -57,8 +57,8 @@
> if output:
> for s in output.splitlines():
> s = re.sub(r'\s+', ' ', s)
> - # Ignore hidden sessions (named sessions that start with a ".")
> - if s and s != " " and (s.find(" ") == 0 and len(s) > 1 and s.count("..") == 0):
> + # Ignore hidden sessions (named sessions that start with a "." or a "_")
> + if s and s != " " and (s.find(" ") == 0 and len(s) > 1 and s.count("..") == 0 and s.count("._") == 0):
> text.append("screen: %s" % s.strip())
> items = s.split(" ")
> sessions.append("screen____%s" % items[1])
> @@ -71,7 +71,8 @@
> output = output.decode(sys.stdout.encoding)
> if output:
> for s in output.splitlines():
> - if s:
> + # Ignore hidden sessions (named sessions that start with a "_")
> + if s and not s.startswith("_"):
> text.append("tmux: %s" % s.strip())
> sessions.append("tmux____%s" % s.split(":")[0])
> i += 1
>
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'usr/lib/byobu/include/select-session.py'
2--- usr/lib/byobu/include/select-session.py 2014-03-17 01:32:43 +0000
3+++ usr/lib/byobu/include/select-session.py 2014-05-31 14:19:17 +0000
4@@ -57,8 +57,8 @@
5 if output:
6 for s in output.splitlines():
7 s = re.sub(r'\s+', ' ', s)
8- # Ignore hidden sessions (named sessions that start with a ".")
9- if s and s != " " and (s.find(" ") == 0 and len(s) > 1 and s.count("..") == 0):
10+ # Ignore hidden sessions (named sessions that start with a "." or a "_")
11+ if s and s != " " and (s.find(" ") == 0 and len(s) > 1 and s.count("..") == 0 and s.count("._") == 0):
12 text.append("screen: %s" % s.strip())
13 items = s.split(" ")
14 sessions.append("screen____%s" % items[1])
15@@ -71,7 +71,8 @@
16 output = output.decode(sys.stdout.encoding)
17 if output:
18 for s in output.splitlines():
19- if s:
20+ # Ignore hidden sessions (named sessions that start with a "_")
21+ if s and not s.startswith("_"):
22 text.append("tmux: %s" % s.strip())
23 sessions.append("tmux____%s" % s.split(":")[0])
24 i += 1

Subscribers

People subscribed via source and target branches