mirror of
https://github.com/tmux/tmux.git
synced 2024-11-18 10:28:54 +00:00
Add pane_current_command format.
This commit is contained in:
parent
7d3c1016ce
commit
1db4ec6e63
3
format.c
3
format.c
@ -377,6 +377,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
|
||||
u_int i;
|
||||
u_int idx;
|
||||
const char *cwd;
|
||||
const char *cmd;
|
||||
|
||||
size = 0;
|
||||
for (i = 0; i < gd->hsize; i++) {
|
||||
@ -410,6 +411,8 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
|
||||
format_add(ft, "pane_start_path", "%s", wp->cwd);
|
||||
if ((cwd = osdep_get_cwd(wp->fd)) != NULL)
|
||||
format_add(ft, "pane_current_path", "%s", cwd);
|
||||
if ((cmd = osdep_get_name(wp->fd, wp->tty)) != NULL)
|
||||
format_add(ft, "pane_current_command", "%s", cmd);
|
||||
|
||||
format_add(ft, "cursor_x", "%d", wp->base.cx);
|
||||
format_add(ft, "cursor_y", "%d", wp->base.cy);
|
||||
|
1
tmux.1
1
tmux.1
@ -3020,6 +3020,7 @@ The following variables are available, where appropriate:
|
||||
.It Li "mouse_standard_flag" Ta "Pane mouse standard flag"
|
||||
.It Li "mouse_utf8_flag" Ta "Pane mouse UTF-8 flag"
|
||||
.It Li "pane_active" Ta "1 if active pane"
|
||||
.It Li "pane_current_command" Ta "Current command if available"
|
||||
.It Li "pane_current_path" Ta "Current path if available"
|
||||
.It Li "pane_dead" Ta "1 if pane is dead"
|
||||
.It Li "pane_height" Ta "Height of pane"
|
||||
|
Loading…
Reference in New Issue
Block a user