aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--names.c4
-rw-r--r--tty.c15
2 files changed, 15 insertions, 4 deletions
diff --git a/names.c b/names.c
index 1997899e..661ba06e 100644
--- a/names.c
+++ b/names.c
@@ -151,7 +151,9 @@ parse_window_name(const char *in)
if (*name != '\0') {
ptr = name + strlen(name) - 1;
- while (ptr > name && !isalnum((u_char)*ptr))
+ while (ptr > name &&
+ !isalnum((u_char)*ptr) &&
+ !ispunct((u_char)*ptr))
*ptr-- = '\0';
}
diff --git a/tty.c b/tty.c
index 77291daa..2d3f2b86 100644
--- a/tty.c
+++ b/tty.c
@@ -885,7 +885,7 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
u_int i, j, sx, nx, width;
int flags, cleared = 0;
char buf[512];
- size_t len;
+ size_t len, old_len;
flags = (tty->flags & TTY_NOCURSOR);
tty->flags |= TTY_NOCURSOR;
@@ -973,8 +973,17 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
}
}
if (len != 0) {
- tty_attributes(tty, &last, wp);
- tty_putn(tty, buf, len, width);
+ if (grid_cells_equal(&last, &grid_default_cell)) {
+ old_len = len;
+ while (len > 0 && buf[len - 1] == ' ')
+ len--;
+ log_debug("%s: trimmed %zu spaces", __func__,
+ old_len - len);
+ }
+ if (len != 0) {
+ tty_attributes(tty, &last, wp);
+ tty_putn(tty, buf, len, width);
+ }
}
nx = screen_size_x(s) - sx;