Add tmux patches for wip/tmux too - pkgsrc-localpatches - leot's pkgsrc LOCALPATCHES
(HTM) hg clone https://bitbucket.org/iamleot/pkgsrc-localpatches
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) changeset cb9386c2cb02c9b1a5fb5a2f1b4af1eefde9afd5
(DIR) parent f000b675c6f814f0855ea95e37b2eb38d2eaeab4
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Tue, 4 Sep 2018 09:23:31
Add tmux patches for wip/tmux too
Diffstat:
wip/tmux/patch-osdep-netbsd.c | 43 ++++++++++++++++++++++++++++++++++++++
wip/tmux/patch-window-copy.c.patch | 14 ++++++++++++
2 files changed, 57 insertions(+), 0 deletions(-)
---
diff -r f000b675c6f8 -r cb9386c2cb02 wip/tmux/patch-osdep-netbsd.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/wip/tmux/patch-osdep-netbsd.c Tue Sep 04 09:23:31 2018 +0200
@@ -0,0 +1,43 @@
+$NetBSD$
+
+Implement osdep_get_cwd() via mount_procfs(8) (inspired by osdep-sunos.c).
+
+--- osdep-netbsd.c.orig 2016-01-21 00:00:28.000000000 +0000
++++ osdep-netbsd.c
+@@ -23,10 +23,13 @@
+
+ #include <errno.h>
+ #include <event.h>
++#include <limits.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+
++#include "tmux.h"
++
+ #define is_runnable(p) \
+ ((p)->p_stat == LSRUN || (p)->p_stat == SIDL)
+ #define is_stopped(p) \
+@@ -127,6 +130,22 @@ error:
+ char *
+ osdep_get_cwd(int fd)
+ {
++ static char target[PATH_MAX + 1];
++ char *path;
++ pid_t pgrp;
++ ssize_t n;
++
++ if ((pgrp = tcgetpgrp(fd)) == -1)
++ return (NULL);
++
++ xasprintf(&path, "/proc/%u/cwd", (u_int) pgrp);
++ n = readlink(path, target, sizeof(target) - 1);
++ free(path);
++ if (n > 0) {
++ target[n] = '\0';
++ return (target);
++ }
++
+ return (NULL);
+ }
+
diff -r f000b675c6f8 -r cb9386c2cb02 wip/tmux/patch-window-copy.c.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/wip/tmux/patch-window-copy.c.patch Tue Sep 04 09:23:31 2018 +0200
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Do not show the `$' at the end of the lines (like it was in tmux<2.3).
+
+--- window-copy.c.orig 2016-09-25 21:24:32.000000000 +0000
++++ window-copy.c
+@@ -1306,7 +1306,6 @@ window_copy_write_line(struct window_pan
+ if (py == data->cy && data->cx == screen_size_x(s)) {
+ memcpy(&gc, &grid_default_cell, sizeof gc);
+ screen_write_cursormove(ctx, screen_size_x(s) - 1, py);
+- screen_write_putc(ctx, &gc, '$');
+ }
+ }
+