aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--format.c2
-rw-r--r--input.c6
-rw-r--r--screen.c8
-rw-r--r--tmux.19
-rw-r--r--tmux.h2
5 files changed, 23 insertions, 4 deletions
diff --git a/format.c b/format.c
index d70b4f44..251af7df 100644
--- a/format.c
+++ b/format.c
@@ -2283,6 +2283,8 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp)
format_add(ft, "pane_width", "%u", wp->sx);
format_add(ft, "pane_height", "%u", wp->sy);
format_add(ft, "pane_title", "%s", wp->base.title);
+ if (wp->base.path != NULL)
+ format_add(ft, "pane_path", "%s", wp->base.path);
format_add(ft, "pane_id", "%%%u", wp->id);
format_add(ft, "pane_active", "%d", wp == w->active);
format_add(ft, "pane_input_off", "%d", !!(wp->flags & PANE_INPUTOFF));
diff --git a/input.c b/input.c
index cec46a99..96fd5d33 100644
--- a/input.c
+++ b/input.c
@@ -2211,6 +2211,12 @@ input_exit_osc(struct input_ctx *ictx)
case 4:
input_osc_4(ictx, p);
break;
+ case 7:
+ if (utf8_isvalid(p)) {
+ screen_set_path(sctx->s, p);
+ server_status_window(ictx->wp->window);
+ }
+ break;
case 10:
input_osc_10(ictx, p);
break;
diff --git a/screen.c b/screen.c
index 9b67e7e8..405932ef 100644
--- a/screen.c
+++ b/screen.c
@@ -158,6 +158,14 @@ screen_set_title(struct screen *s, const char *title)
utf8_stravis(&s->title, title, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);
}
+/* Set screen path. */
+void
+screen_set_path(struct screen *s, const char *path)
+{
+ free(s->path);
+ utf8_stravis(&s->path, path, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);
+}
+
/* Push the current title onto the stack. */
void
screen_push_title(struct screen *s)
diff --git a/tmux.1 b/tmux.1
index bb713d4a..833271a3 100644
--- a/tmux.1
+++ b/tmux.1
@@ -4273,7 +4273,7 @@ The following variables are available, where appropriate:
.It Li "pane_current_path" Ta "" Ta "Current path if available"
.It Li "pane_dead" Ta "" Ta "1 if pane is dead"
.It Li "pane_dead_status" Ta "" Ta "Exit status of process in dead pane"
-.It Li "pane_format" Ta "" Ta "1 if format is for a pane (not assuming the current)"
+.It Li "pane_format" Ta "" Ta "1 if format is for a pane"
.It Li "pane_height" Ta "" Ta "Height of pane"
.It Li "pane_id" Ta "#D" Ta "Unique pane ID"
.It Li "pane_in_mode" Ta "" Ta "1 if pane is in a mode"
@@ -4283,6 +4283,7 @@ The following variables are available, where appropriate:
.It Li "pane_marked" Ta "" Ta "1 if this is the marked pane"
.It Li "pane_marked_set" Ta "" Ta "1 if a marked pane is set"
.It Li "pane_mode" Ta "" Ta "Name of pane mode, if any"
+.It Li "pane_path" Ta "#T" Ta "Path of pane (can be set by application)"
.It Li "pane_pid" Ta "" Ta "PID of first process in pane"
.It Li "pane_pipe" Ta "" Ta "1 if pane is being piped"
.It Li "pane_right" Ta "" Ta "Right of pane"
@@ -4290,7 +4291,7 @@ The following variables are available, where appropriate:
.It Li "pane_start_command" Ta "" Ta "Command pane started with"
.It Li "pane_synchronized" Ta "" Ta "1 if pane is synchronized"
.It Li "pane_tabs" Ta "" Ta "Pane tab positions"
-.It Li "pane_title" Ta "#T" Ta "Title of pane"
+.It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)"
.It Li "pane_top" Ta "" Ta "Top of pane"
.It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
.It Li "pane_width" Ta "" Ta "Width of pane"
@@ -4308,7 +4309,7 @@ The following variables are available, where appropriate:
.It Li "session_alerts" Ta "" Ta "List of window indexes with alerts"
.It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
.It Li "session_created" Ta "" Ta "Time session created"
-.It Li "session_format" Ta "" Ta "1 if format is for a session (not assuming the current)"
+.It Li "session_format" Ta "" Ta "1 if format is for a session"
.It Li "session_group" Ta "" Ta "Name of session group"
.It Li "session_group_list" Ta "" Ta "List of sessions in group"
.It Li "session_group_size" Ta "" Ta "Size of session group"
@@ -4329,7 +4330,7 @@ The following variables are available, where appropriate:
.It Li "window_bigger" Ta "" Ta "1 if window is larger than client"
.It Li "window_end_flag" Ta "" Ta "1 if window has the highest index"
.It Li "window_flags" Ta "#F" Ta "Window flags"
-.It Li "window_format" Ta "" Ta "1 if format is for a window (not assuming the current)"
+.It Li "window_format" Ta "" Ta "1 if format is for a window"
.It Li "window_height" Ta "" Ta "Height of window"
.It Li "window_id" Ta "" Ta "Unique window ID"
.It Li "window_index" Ta "#I" Ta "Index of window"
diff --git a/tmux.h b/tmux.h
index 44af8c25..53feefd8 100644
--- a/tmux.h
+++ b/tmux.h
@@ -708,6 +708,7 @@ struct screen_sel;
struct screen_titles;
struct screen {
char *title;
+ char *path;
struct screen_titles *titles;
struct grid *grid; /* grid data */
@@ -2361,6 +2362,7 @@ void screen_reset_tabs(struct screen *);
void screen_set_cursor_style(struct screen *, u_int);
void screen_set_cursor_colour(struct screen *, const char *);
void screen_set_title(struct screen *, const char *);
+void screen_set_path(struct screen *, const char *);
void screen_push_title(struct screen *);
void screen_pop_title(struct screen *);
void screen_resize(struct screen *, u_int, u_int, int);