After c231381aa3a22340e787baaf78781d9b8ecd6a2c ("Demote the
old single-character replacement variables #S")

Before this patch, the next command produce '##S':
set-option -g status-right '###S'
---
I don't sure that this patch must edit format_expand(), but that was easier.

 format.c | 4 +++-
 status.c | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/format.c b/format.c
index de6d8c8..f9c3e75 100644
--- a/format.c
+++ b/format.c
@@ -333,7 +333,9 @@ format_expand(struct format_tree *ft, const char *fmt)
                                        len *= 2;
                                }
                                buf[off++] = '#';
-                               buf[off++] = ch;
+                               if (ch != '#') {
+                                       buf[off++] = ch;
+                               }
                                continue;
                        }
                        n = strlen(s);
diff --git a/status.c b/status.c
index 358f809..3618d3f 100644
--- a/status.c
+++ b/status.c
@@ -419,6 +419,9 @@ status_replace1(struct client *c, char **iptr, char **optr, 
char *out,
                goto do_replace;
        case '#':
                *(*optr)++ = '#';
+               if (*(*iptr) && *(*iptr) == '#') {
+                       *(*optr)++ = '#';
+               }
                break;
        default:
                xsnprintf(tmp, sizeof tmp, "#%c", *(*iptr - 1));
-- 
1.8.5.2


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to