Merge lp:~jefferyto/byobu/fix-trailing-hash into lp:byobu

Proposed by Jeffery To on 2020-02-18
Status: Needs review
Proposed branch: lp:~jefferyto/byobu/fix-trailing-hash
Merge into: lp:byobu
Diff against target: 44 lines (+14/-2)
2 files modified
debian/changelog (+4/-0)
usr/lib/byobu/users (+10/-2)
To merge this branch: bzr merge lp:~jefferyto/byobu/fix-trailing-hash
Reviewer Review Type Date Requested Status
Dustin Kirkland  2020-02-18 Pending
Review via email: mp+379412@code.launchpad.net

Description of the change

To show a literal '#', tmux needs two '#' characters while screen needs only one.

To post a comment you must log in.

Unmerged revisions

2644. By Jeffery To on 2020-02-18

* usr/lib/byobu/users:
  - Fix trailing '#' sign for screen

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2020-02-17 14:15:05 +0000
3+++ debian/changelog 2020-02-18 20:36:39 +0000
4@@ -2,6 +2,10 @@
5
6 * UNRELEASED
7
8+ [ Jeffery To ]
9+ * usr/lib/byobu/users:
10+ - Fix trailing '#' sign for screen
11+
12 -- Dustin Kirkland <kirkland@ubuntu.com> Mon, 17 Feb 2020 08:15:04 -0600
13
14 byobu (5.133-0ubuntu1) focal; urgency=medium
15
16=== modified file 'usr/lib/byobu/users'
17--- usr/lib/byobu/users 2019-05-26 19:18:32 +0000
18+++ usr/lib/byobu/users 2020-02-18 20:36:39 +0000
19@@ -26,7 +26,7 @@
20 }
21
22 __users() {
23- local count=0
24+ local count=0 sign
25 if [ "$USERS_DISTINCT" = "1" ]; then
26 count=$(pgrep -fl 'sshd:.*@' | cut -f3 -d\ | cut -f1 -d@ | sort -u | wc -l)
27 else
28@@ -35,7 +35,15 @@
29 count=$(pgrep -f "^sshd:.*@|^/usr/sbin/sshd -i" | wc -l) || return
30 fi
31 if [ $count -gt 0 ]; then
32- color b w r; printf "%d" "$count"; color -; color w r; printf "##"; color --
33+ case "$BYOBU_BACKEND" in
34+ tmux)
35+ sign="##"
36+ ;;
37+ screen)
38+ sign="#"
39+ ;;
40+ esac
41+ color b w r; printf "%d" "$count"; color -; color w r; printf "$sign"; color --
42 else
43 rm -f "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/users"*
44 fi

Subscribers

People subscribed via source and target branches