mirror of
https://github.com/tmux/tmux.git
synced 2025-04-23 12:58:50 +00:00
Merge branch 'obsd-master'
Conflicts: Makefile tmux.1 window.c
This commit is contained in:
commit
953c3ef47a
Makefile.amarguments.ccfg.cclient.ccmd-break-pane.ccmd-choose-list.ccmd-find-window.ccmd-join-pane.ccmd-list.ccmd-lock-server.ccmd-new-session.ccmd-new-window.ccmd-queue.ccmd-respawn-pane.ccmd-respawn-window.ccmd-run-shell.ccmd-save-buffer.ccmd-select-layout.ccmd-set-option.ccmd-show-options.ccmd-split-window.ccmd-switch-client.ccmd.cenviron.cformat.cgrid-view.cgrid.cinput.cjob.ckey-bindings.clayout-set.coptions-table.cosdep-openbsd.cscreen-write.cserver-client.cserver-fn.cserver-window.cserver.csession.cstatus.ctmux.1tmux.ctmux.htty-term.ctty.cutf8.cwindow-choose.cwindow-copy.cwindow.c
@ -73,7 +73,6 @@ dist_tmux_SOURCES = \
|
|||||||
cmd-capture-pane.c \
|
cmd-capture-pane.c \
|
||||||
cmd-choose-buffer.c \
|
cmd-choose-buffer.c \
|
||||||
cmd-choose-client.c \
|
cmd-choose-client.c \
|
||||||
cmd-choose-list.c \
|
|
||||||
cmd-choose-tree.c \
|
cmd-choose-tree.c \
|
||||||
cmd-clear-history.c \
|
cmd-clear-history.c \
|
||||||
cmd-clock-mode.c \
|
cmd-clock-mode.c \
|
||||||
|
12
arguments.c
12
arguments.c
@ -125,7 +125,7 @@ args_free(struct args *args)
|
|||||||
size_t
|
size_t
|
||||||
args_print(struct args *args, char *buf, size_t len)
|
args_print(struct args *args, char *buf, size_t len)
|
||||||
{
|
{
|
||||||
size_t off;
|
size_t off, used;
|
||||||
int i;
|
int i;
|
||||||
const char *quotes;
|
const char *quotes;
|
||||||
struct args_entry *entry;
|
struct args_entry *entry;
|
||||||
@ -165,9 +165,12 @@ args_print(struct args *args, char *buf, size_t len)
|
|||||||
quotes = "\"";
|
quotes = "\"";
|
||||||
else
|
else
|
||||||
quotes = "";
|
quotes = "";
|
||||||
off += xsnprintf(buf + off, len - off, "%s-%c %s%s%s",
|
used = xsnprintf(buf + off, len - off, "%s-%c %s%s%s",
|
||||||
off != 0 ? " " : "", entry->flag, quotes, entry->value,
|
off != 0 ? " " : "", entry->flag, quotes, entry->value,
|
||||||
quotes);
|
quotes);
|
||||||
|
if (used > len - off)
|
||||||
|
used = len - off;
|
||||||
|
off += used;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* And finally the argument vector. */
|
/* And finally the argument vector. */
|
||||||
@ -181,8 +184,11 @@ args_print(struct args *args, char *buf, size_t len)
|
|||||||
quotes = "\"";
|
quotes = "\"";
|
||||||
else
|
else
|
||||||
quotes = "";
|
quotes = "";
|
||||||
off += xsnprintf(buf + off, len - off, "%s%s%s%s",
|
used = xsnprintf(buf + off, len - off, "%s%s%s%s",
|
||||||
off != 0 ? " " : "", quotes, args->argv[i], quotes);
|
off != 0 ? " " : "", quotes, args->argv[i], quotes);
|
||||||
|
if (used > len - off)
|
||||||
|
used = len - off;
|
||||||
|
off += used;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (off);
|
return (off);
|
||||||
|
1
cfg.c
1
cfg.c
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
2
client.c
2
client.c
@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <event.h>
|
#include <event.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -65,16 +65,7 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
server_unzoom_window(w);
|
server_unzoom_window(w);
|
||||||
|
|
||||||
TAILQ_REMOVE(&w->panes, wp, entry);
|
TAILQ_REMOVE(&w->panes, wp, entry);
|
||||||
if (wp == w->active) {
|
window_lost_pane(w, wp);
|
||||||
w->active = w->last;
|
|
||||||
w->last = NULL;
|
|
||||||
if (w->active == NULL) {
|
|
||||||
w->active = TAILQ_PREV(wp, window_panes, entry);
|
|
||||||
if (w->active == NULL)
|
|
||||||
w->active = TAILQ_NEXT(wp, entry);
|
|
||||||
}
|
|
||||||
} else if (wp == w->last)
|
|
||||||
w->last = NULL;
|
|
||||||
layout_close_pane(wp);
|
layout_close_pane(wp);
|
||||||
|
|
||||||
w = wp->window = window_create1(s->sx, s->sy);
|
w = wp->window = window_create1(s->sx, s->sy);
|
||||||
|
@ -1,97 +0,0 @@
|
|||||||
/* $Id$ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2012 Thomas Adam <thomas@xteddy.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, and distribute this software for any
|
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
|
||||||
* copyright notice and this permission notice appear in all copies.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "tmux.h"
|
|
||||||
|
|
||||||
#define CMD_CHOOSE_LIST_DEFAULT_TEMPLATE "run-shell '%%'"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enter choose mode to choose a custom list.
|
|
||||||
*/
|
|
||||||
|
|
||||||
enum cmd_retval cmd_choose_list_exec(struct cmd *, struct cmd_q *);
|
|
||||||
|
|
||||||
const struct cmd_entry cmd_choose_list_entry = {
|
|
||||||
"choose-list", NULL,
|
|
||||||
"l:t:", 0, 1,
|
|
||||||
"[-l items] " CMD_TARGET_WINDOW_USAGE "[template]",
|
|
||||||
0,
|
|
||||||
NULL,
|
|
||||||
cmd_choose_list_exec
|
|
||||||
};
|
|
||||||
|
|
||||||
enum cmd_retval
|
|
||||||
cmd_choose_list_exec(struct cmd *self, struct cmd_q *cmdq)
|
|
||||||
{
|
|
||||||
struct args *args = self->args;
|
|
||||||
struct client *c;
|
|
||||||
struct winlink *wl;
|
|
||||||
const char *list1;
|
|
||||||
char *template, *item, *copy, *list;
|
|
||||||
u_int idx;
|
|
||||||
|
|
||||||
if ((c = cmd_current_client(cmdq)) == NULL) {
|
|
||||||
cmdq_error(cmdq, "no client available");
|
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((list1 = args_get(args, 'l')) == NULL)
|
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
|
|
||||||
if ((wl = cmd_find_window(cmdq, args_get(args, 't'), NULL)) == NULL)
|
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
|
|
||||||
if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0)
|
|
||||||
return (CMD_RETURN_NORMAL);
|
|
||||||
|
|
||||||
if (args->argc != 0)
|
|
||||||
template = xstrdup(args->argv[0]);
|
|
||||||
else
|
|
||||||
template = xstrdup(CMD_CHOOSE_LIST_DEFAULT_TEMPLATE);
|
|
||||||
|
|
||||||
copy = list = xstrdup(list1);
|
|
||||||
idx = 0;
|
|
||||||
while ((item = strsep(&list, ",")) != NULL)
|
|
||||||
{
|
|
||||||
if (*item == '\0') /* no empty entries */
|
|
||||||
continue;
|
|
||||||
window_choose_add_item(wl->window->active, c, wl, item,
|
|
||||||
template, idx);
|
|
||||||
idx++;
|
|
||||||
}
|
|
||||||
free(copy);
|
|
||||||
|
|
||||||
if (idx == 0) {
|
|
||||||
free(template);
|
|
||||||
window_pane_reset_mode(wl->window->active);
|
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
window_choose_ready(wl->window->active, 0, NULL);
|
|
||||||
|
|
||||||
free(template);
|
|
||||||
|
|
||||||
return (CMD_RETURN_NORMAL);
|
|
||||||
}
|
|
@ -84,7 +84,8 @@ cmd_find_window_match_flags(struct args *args)
|
|||||||
|
|
||||||
void
|
void
|
||||||
cmd_find_window_match(struct cmd_find_window_data_list *find_list,
|
cmd_find_window_match(struct cmd_find_window_data_list *find_list,
|
||||||
int match_flags, struct winlink *wl, const char *str, const char *searchstr)
|
int match_flags, struct winlink *wl, const char *str,
|
||||||
|
const char *searchstr)
|
||||||
{
|
{
|
||||||
struct cmd_find_window_data find_data;
|
struct cmd_find_window_data find_data;
|
||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
|
@ -138,11 +138,7 @@ join_pane(struct cmd *self, struct cmd_q *cmdq, int not_same_window)
|
|||||||
|
|
||||||
layout_close_pane(src_wp);
|
layout_close_pane(src_wp);
|
||||||
|
|
||||||
if (src_w->active == src_wp) {
|
window_lost_pane(src_w, src_wp);
|
||||||
src_w->active = TAILQ_PREV(src_wp, window_panes, entry);
|
|
||||||
if (src_w->active == NULL)
|
|
||||||
src_w->active = TAILQ_NEXT(src_wp, entry);
|
|
||||||
}
|
|
||||||
TAILQ_REMOVE(&src_w->panes, src_wp, entry);
|
TAILQ_REMOVE(&src_w->panes, src_wp, entry);
|
||||||
|
|
||||||
if (window_count_panes(src_w) == 0)
|
if (window_count_panes(src_w) == 0)
|
||||||
|
10
cmd-list.c
10
cmd-list.c
@ -103,7 +103,7 @@ size_t
|
|||||||
cmd_list_print(struct cmd_list *cmdlist, char *buf, size_t len)
|
cmd_list_print(struct cmd_list *cmdlist, char *buf, size_t len)
|
||||||
{
|
{
|
||||||
struct cmd *cmd;
|
struct cmd *cmd;
|
||||||
size_t off;
|
size_t off, used;
|
||||||
|
|
||||||
off = 0;
|
off = 0;
|
||||||
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
|
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
|
||||||
@ -112,8 +112,12 @@ cmd_list_print(struct cmd_list *cmdlist, char *buf, size_t len)
|
|||||||
off += cmd_print(cmd, buf + off, len - off);
|
off += cmd_print(cmd, buf + off, len - off);
|
||||||
if (off >= len)
|
if (off >= len)
|
||||||
break;
|
break;
|
||||||
if (TAILQ_NEXT(cmd, qentry) != NULL)
|
if (TAILQ_NEXT(cmd, qentry) != NULL) {
|
||||||
off += xsnprintf(buf + off, len - off, " ; ");
|
used = xsnprintf(buf + off, len - off, " ; ");
|
||||||
|
if (used > len - off)
|
||||||
|
used = len - off;
|
||||||
|
off += used;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (off);
|
return (off);
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,6 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "tmux.h"
|
#include "tmux.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <pwd.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
@ -55,10 +54,12 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
struct environ env;
|
struct environ env;
|
||||||
struct termios tio, *tiop;
|
struct termios tio, *tiop;
|
||||||
const char *newname, *target, *update, *errstr, *template;
|
const char *newname, *target, *update, *errstr, *template;
|
||||||
|
const char *path;
|
||||||
char *cmd, *cause, *cp;
|
char *cmd, *cause, *cp;
|
||||||
int detached, already_attached, idx, cwd, fd = -1;
|
int detached, already_attached, idx, cwd, fd = -1;
|
||||||
u_int sx, sy;
|
u_int sx, sy;
|
||||||
struct format_tree *ft;
|
struct format_tree *ft;
|
||||||
|
struct environ_entry *envent;
|
||||||
|
|
||||||
if (args_has(args, 't') && (args->argc != 0 || args_has(args, 'n'))) {
|
if (args_has(args, 't') && (args->argc != 0 || args_has(args, 'n'))) {
|
||||||
cmdq_error(cmdq, "command or window name given with target");
|
cmdq_error(cmdq, "command or window name given with target");
|
||||||
@ -189,6 +190,14 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
else
|
else
|
||||||
cmd = options_get_string(&global_s_options, "default-command");
|
cmd = options_get_string(&global_s_options, "default-command");
|
||||||
|
|
||||||
|
path = NULL;
|
||||||
|
if (c != NULL && c->session == NULL)
|
||||||
|
envent = environ_find(&c->environ, "PATH");
|
||||||
|
else
|
||||||
|
envent = environ_find(&global_environ, "PATH");
|
||||||
|
if (envent != NULL)
|
||||||
|
path = envent->value;
|
||||||
|
|
||||||
/* Construct the environment. */
|
/* Construct the environment. */
|
||||||
environ_init(&env);
|
environ_init(&env);
|
||||||
update = options_get_string(&global_s_options, "update-environment");
|
update = options_get_string(&global_s_options, "update-environment");
|
||||||
@ -197,7 +206,8 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
|
|
||||||
/* Create the new session. */
|
/* Create the new session. */
|
||||||
idx = -1 - options_get_number(&global_s_options, "base-index");
|
idx = -1 - options_get_number(&global_s_options, "base-index");
|
||||||
s = session_create(newname, cmd, cwd, &env, tiop, idx, sx, sy, &cause);
|
s = session_create(newname, cmd, path, cwd, &env, tiop, idx, sx, sy,
|
||||||
|
&cause);
|
||||||
if (s == NULL) {
|
if (s == NULL) {
|
||||||
cmdq_error(cmdq, "create session failed: %s", cause);
|
cmdq_error(cmdq, "create session failed: %s", cause);
|
||||||
free(cause);
|
free(cause);
|
||||||
|
@ -49,10 +49,11 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
struct session *s;
|
struct session *s;
|
||||||
struct winlink *wl;
|
struct winlink *wl;
|
||||||
struct client *c;
|
struct client *c;
|
||||||
const char *cmd, *template;
|
const char *cmd, *path, *template;
|
||||||
char *cause, *cp;
|
char *cause, *cp;
|
||||||
int idx, last, detached, cwd, fd = -1;
|
int idx, last, detached, cwd, fd = -1;
|
||||||
struct format_tree *ft;
|
struct format_tree *ft;
|
||||||
|
struct environ_entry *envent;
|
||||||
|
|
||||||
if (args_has(args, 'a')) {
|
if (args_has(args, 'a')) {
|
||||||
wl = cmd_find_window(cmdq, args_get(args, 't'), &s);
|
wl = cmd_find_window(cmdq, args_get(args, 't'), &s);
|
||||||
@ -77,7 +78,8 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
server_unlink_window(s, wl);
|
server_unlink_window(s, wl);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((idx = cmd_find_index(cmdq, args_get(args, 't'), &s)) == -2)
|
idx = cmd_find_index(cmdq, args_get(args, 't'), &s);
|
||||||
|
if (idx == -2)
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
detached = args_has(args, 'd');
|
detached = args_has(args, 'd');
|
||||||
@ -87,6 +89,14 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
else
|
else
|
||||||
cmd = args->argv[0];
|
cmd = args->argv[0];
|
||||||
|
|
||||||
|
path = NULL;
|
||||||
|
if (cmdq->client != NULL && cmdq->client->session == NULL)
|
||||||
|
envent = environ_find(&cmdq->client->environ, "PATH");
|
||||||
|
else
|
||||||
|
envent = environ_find(&s->environ, "PATH");
|
||||||
|
if (envent != NULL)
|
||||||
|
path = envent->value;
|
||||||
|
|
||||||
if (args_has(args, 'c')) {
|
if (args_has(args, 'c')) {
|
||||||
ft = format_create();
|
ft = format_create();
|
||||||
if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL)
|
if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL)
|
||||||
@ -135,7 +145,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
|
|
||||||
if (idx == -1)
|
if (idx == -1)
|
||||||
idx = -1 - options_get_number(&s->options, "base-index");
|
idx = -1 - options_get_number(&s->options, "base-index");
|
||||||
wl = session_new(s, args_get(args, 'n'), cmd, cwd, idx, &cause);
|
wl = session_new(s, args_get(args, 'n'), cmd, path, cwd, idx, &cause);
|
||||||
if (wl == NULL) {
|
if (wl == NULL) {
|
||||||
cmdq_error(cmdq, "create window failed: %s", cause);
|
cmdq_error(cmdq, "create window failed: %s", cause);
|
||||||
free(cause);
|
free(cause);
|
||||||
|
31
cmd-queue.c
31
cmd-queue.c
@ -86,37 +86,6 @@ cmdq_print(struct cmd_q *cmdq, const char *fmt, ...)
|
|||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show info from command. */
|
|
||||||
void printflike2
|
|
||||||
cmdq_info(struct cmd_q *cmdq, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
struct client *c = cmdq->client;
|
|
||||||
va_list ap;
|
|
||||||
char *msg;
|
|
||||||
|
|
||||||
if (options_get_number(&global_options, "quiet"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
|
||||||
|
|
||||||
if (c == NULL)
|
|
||||||
/* nothing */;
|
|
||||||
else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) {
|
|
||||||
evbuffer_add_vprintf(c->stdout_data, fmt, ap);
|
|
||||||
|
|
||||||
evbuffer_add(c->stdout_data, "\n", 1);
|
|
||||||
server_push_stdout(c);
|
|
||||||
} else {
|
|
||||||
xvasprintf(&msg, fmt, ap);
|
|
||||||
*msg = toupper((u_char) *msg);
|
|
||||||
status_message_set(c, "%s", msg);
|
|
||||||
free(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Show error from command. */
|
/* Show error from command. */
|
||||||
void printflike2
|
void printflike2
|
||||||
cmdq_error(struct cmd_q *cmdq, const char *fmt, ...)
|
cmdq_error(struct cmd_q *cmdq, const char *fmt, ...)
|
||||||
|
@ -48,9 +48,10 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
struct session *s;
|
struct session *s;
|
||||||
struct environ env;
|
struct environ env;
|
||||||
const char *cmd;
|
const char *cmd, *path;
|
||||||
char *cause;
|
char *cause;
|
||||||
u_int idx;
|
u_int idx;
|
||||||
|
struct environ_entry *envent;
|
||||||
|
|
||||||
if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL)
|
if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL)
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
@ -77,7 +78,17 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
cmd = args->argv[0];
|
cmd = args->argv[0];
|
||||||
else
|
else
|
||||||
cmd = NULL;
|
cmd = NULL;
|
||||||
if (window_pane_spawn(wp, cmd, NULL, -1, &env, s->tio, &cause) != 0) {
|
|
||||||
|
path = NULL;
|
||||||
|
if (cmdq->client != NULL && cmdq->client->session == NULL)
|
||||||
|
envent = environ_find(&cmdq->client->environ, "PATH");
|
||||||
|
else
|
||||||
|
envent = environ_find(&s->environ, "PATH");
|
||||||
|
if (envent != NULL)
|
||||||
|
path = envent->value;
|
||||||
|
|
||||||
|
if (window_pane_spawn(wp, cmd, path, NULL, -1, &env, s->tio,
|
||||||
|
&cause) != 0) {
|
||||||
cmdq_error(cmdq, "respawn pane failed: %s", cause);
|
cmdq_error(cmdq, "respawn pane failed: %s", cause);
|
||||||
free(cause);
|
free(cause);
|
||||||
environ_free(&env);
|
environ_free(&env);
|
||||||
|
@ -47,8 +47,9 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
struct session *s;
|
struct session *s;
|
||||||
struct environ env;
|
struct environ env;
|
||||||
const char *cmd;
|
const char *cmd, *path;
|
||||||
char *cause;
|
char *cause;
|
||||||
|
struct environ_entry *envent;
|
||||||
|
|
||||||
if ((wl = cmd_find_window(cmdq, args_get(args, 't'), &s)) == NULL)
|
if ((wl = cmd_find_window(cmdq, args_get(args, 't'), &s)) == NULL)
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
@ -79,7 +80,17 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
cmd = args->argv[0];
|
cmd = args->argv[0];
|
||||||
else
|
else
|
||||||
cmd = NULL;
|
cmd = NULL;
|
||||||
if (window_pane_spawn(wp, cmd, NULL, -1, &env, s->tio, &cause) != 0) {
|
|
||||||
|
path = NULL;
|
||||||
|
if (cmdq->client != NULL && cmdq->client->session == NULL)
|
||||||
|
envent = environ_find(&cmdq->client->environ, "PATH");
|
||||||
|
else
|
||||||
|
envent = environ_find(&s->environ, "PATH");
|
||||||
|
if (envent != NULL)
|
||||||
|
path = envent->value;
|
||||||
|
|
||||||
|
if (window_pane_spawn(wp, cmd, path, NULL, -1, &env, s->tio,
|
||||||
|
&cause) != 0) {
|
||||||
cmdq_error(cmdq, "respawn window failed: %s", cause);
|
cmdq_error(cmdq, "respawn window failed: %s", cause);
|
||||||
free(cause);
|
free(cause);
|
||||||
environ_free(&env);
|
environ_free(&env);
|
||||||
|
@ -161,13 +161,9 @@ cmd_run_shell_callback(struct job *job)
|
|||||||
retcode = WTERMSIG(job->status);
|
retcode = WTERMSIG(job->status);
|
||||||
xasprintf(&msg, "'%s' terminated by signal %d", cmd, retcode);
|
xasprintf(&msg, "'%s' terminated by signal %d", cmd, retcode);
|
||||||
}
|
}
|
||||||
if (msg != NULL) {
|
if (msg != NULL)
|
||||||
if (lines == 0)
|
cmd_run_shell_print(job, msg);
|
||||||
cmdq_info(cmdq, "%s", msg);
|
free(msg);
|
||||||
else
|
|
||||||
cmd_run_shell_print(job, msg);
|
|
||||||
free(msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -111,7 +111,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
f = fdopen(fd, "ab");
|
f = fdopen(fd, "ab");
|
||||||
} else {
|
} else {
|
||||||
fd = openat(cwd, path, O_CREAT|O_RDWR, 0600);
|
fd = openat(cwd, path, O_CREAT|O_RDWR|O_TRUNC, 0600);
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
f = fdopen(fd, "wb");
|
f = fdopen(fd, "wb");
|
||||||
}
|
}
|
||||||
@ -141,7 +141,6 @@ do_print:
|
|||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
msg = NULL;
|
msg = NULL;
|
||||||
msglen = 0;
|
|
||||||
|
|
||||||
used = 0;
|
used = 0;
|
||||||
while (used != pb->size) {
|
while (used != pb->size) {
|
||||||
|
@ -104,7 +104,6 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
else
|
else
|
||||||
layout = layout_set_previous(wl->window);
|
layout = layout_set_previous(wl->window);
|
||||||
server_redraw_window(wl->window);
|
server_redraw_window(wl->window);
|
||||||
cmdq_info(cmdq, "arranging in: %s", layout_set_name(layout));
|
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +114,6 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
if (layout != -1) {
|
if (layout != -1) {
|
||||||
layout = layout_set_select(wl->window, layout);
|
layout = layout_set_select(wl->window, layout);
|
||||||
server_redraw_window(wl->window);
|
server_redraw_window(wl->window);
|
||||||
cmdq_info(cmdq, "arranging in: %s", layout_set_name(layout));
|
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +124,6 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
server_redraw_window(wl->window);
|
server_redraw_window(wl->window);
|
||||||
cmdq_info(cmdq, "arranging in: %s", layoutname);
|
|
||||||
}
|
}
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
|
@ -117,8 +117,11 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
if (oe == NULL) {
|
if (oe == NULL) {
|
||||||
cmdq_error(cmdq, "unknown option: %s", optstr);
|
if (!args_has(args, 'q')) {
|
||||||
return (CMD_RETURN_ERROR);
|
cmdq_error(cmdq, "unknown option: %s", optstr);
|
||||||
|
return (CMD_RETURN_ERROR);
|
||||||
|
}
|
||||||
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Work out the tree from the table. */
|
/* Work out the tree from the table. */
|
||||||
@ -163,8 +166,10 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
} else {
|
} else {
|
||||||
if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) {
|
if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) {
|
||||||
if (!args_has(args, 'q'))
|
if (!args_has(args, 'q')) {
|
||||||
cmdq_print(cmdq, "already set: %s", optstr);
|
cmdq_error(cmdq, "already set: %s", optstr);
|
||||||
|
return (CMD_RETURN_ERROR);
|
||||||
|
}
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
if (cmd_set_option_set(self, cmdq, oe, oo, valstr) != 0)
|
if (cmd_set_option_set(self, cmdq, oe, oo, valstr) != 0)
|
||||||
@ -229,8 +234,11 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char* optstr,
|
|||||||
|
|
||||||
if (args_has(args, 'u')) {
|
if (args_has(args, 'u')) {
|
||||||
if (options_find1(oo, optstr) == NULL) {
|
if (options_find1(oo, optstr) == NULL) {
|
||||||
cmdq_error(cmdq, "unknown option: %s", optstr);
|
if (!args_has(args, 'q')) {
|
||||||
return (CMD_RETURN_ERROR);
|
cmdq_error(cmdq, "unknown option: %s", optstr);
|
||||||
|
return (CMD_RETURN_ERROR);
|
||||||
|
}
|
||||||
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
if (valstr != NULL) {
|
if (valstr != NULL) {
|
||||||
cmdq_error(cmdq, "value passed to unset option: %s",
|
cmdq_error(cmdq, "value passed to unset option: %s",
|
||||||
@ -244,15 +252,13 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char* optstr,
|
|||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) {
|
if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) {
|
||||||
if (!args_has(args, 'q'))
|
if (!args_has(args, 'q')) {
|
||||||
cmdq_print(cmdq, "already set: %s", optstr);
|
cmdq_error(cmdq, "already set: %s", optstr);
|
||||||
|
return CMD_RETURN_ERROR;
|
||||||
|
}
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
options_set_string(oo, optstr, "%s", valstr);
|
options_set_string(oo, optstr, "%s", valstr);
|
||||||
if (!args_has(args, 'q')) {
|
|
||||||
cmdq_info(cmdq, "set option: %s -> %s", optstr,
|
|
||||||
valstr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
@ -261,7 +267,8 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char* optstr,
|
|||||||
/* Unset an option. */
|
/* Unset an option. */
|
||||||
int
|
int
|
||||||
cmd_set_option_unset(struct cmd *self, struct cmd_q *cmdq,
|
cmd_set_option_unset(struct cmd *self, struct cmd_q *cmdq,
|
||||||
const struct options_table_entry *oe, struct options *oo, const char *value)
|
const struct options_table_entry *oe, struct options *oo,
|
||||||
|
const char *value)
|
||||||
{
|
{
|
||||||
struct args *args = self->args;
|
struct args *args = self->args;
|
||||||
|
|
||||||
@ -275,19 +282,16 @@ cmd_set_option_unset(struct cmd *self, struct cmd_q *cmdq,
|
|||||||
}
|
}
|
||||||
|
|
||||||
options_remove(oo, oe->name);
|
options_remove(oo, oe->name);
|
||||||
if (!args_has(args, 'q'))
|
|
||||||
cmdq_info(cmdq, "unset option: %s", oe->name);
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set an option. */
|
/* Set an option. */
|
||||||
int
|
int
|
||||||
cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq,
|
cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq,
|
||||||
const struct options_table_entry *oe, struct options *oo, const char *value)
|
const struct options_table_entry *oe, struct options *oo,
|
||||||
|
const char *value)
|
||||||
{
|
{
|
||||||
struct args *args = self->args;
|
|
||||||
struct options_entry *o;
|
struct options_entry *o;
|
||||||
const char *s;
|
|
||||||
|
|
||||||
if (oe->type != OPTIONS_TABLE_FLAG && value == NULL) {
|
if (oe->type != OPTIONS_TABLE_FLAG && value == NULL) {
|
||||||
cmdq_error(cmdq, "empty value");
|
cmdq_error(cmdq, "empty value");
|
||||||
@ -327,17 +331,14 @@ cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq,
|
|||||||
}
|
}
|
||||||
if (o == NULL)
|
if (o == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
s = options_table_print_entry(oe, o, 0);
|
|
||||||
if (!args_has(args, 'q'))
|
|
||||||
cmdq_info(cmdq, "set option: %s -> %s", oe->name, s);
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set a string option. */
|
/* Set a string option. */
|
||||||
struct options_entry *
|
struct options_entry *
|
||||||
cmd_set_option_string(struct cmd *self, unused struct cmd_q *cmdq,
|
cmd_set_option_string(struct cmd *self, unused struct cmd_q *cmdq,
|
||||||
const struct options_table_entry *oe, struct options *oo, const char *value)
|
const struct options_table_entry *oe, struct options *oo,
|
||||||
|
const char *value)
|
||||||
{
|
{
|
||||||
struct args *args = self->args;
|
struct args *args = self->args;
|
||||||
struct options_entry *o;
|
struct options_entry *o;
|
||||||
@ -358,7 +359,8 @@ cmd_set_option_string(struct cmd *self, unused struct cmd_q *cmdq,
|
|||||||
/* Set a number option. */
|
/* Set a number option. */
|
||||||
struct options_entry *
|
struct options_entry *
|
||||||
cmd_set_option_number(unused struct cmd *self, struct cmd_q *cmdq,
|
cmd_set_option_number(unused struct cmd *self, struct cmd_q *cmdq,
|
||||||
const struct options_table_entry *oe, struct options *oo, const char *value)
|
const struct options_table_entry *oe, struct options *oo,
|
||||||
|
const char *value)
|
||||||
{
|
{
|
||||||
long long ll;
|
long long ll;
|
||||||
const char *errstr;
|
const char *errstr;
|
||||||
@ -375,7 +377,8 @@ cmd_set_option_number(unused struct cmd *self, struct cmd_q *cmdq,
|
|||||||
/* Set a key option. */
|
/* Set a key option. */
|
||||||
struct options_entry *
|
struct options_entry *
|
||||||
cmd_set_option_key(unused struct cmd *self, struct cmd_q *cmdq,
|
cmd_set_option_key(unused struct cmd *self, struct cmd_q *cmdq,
|
||||||
const struct options_table_entry *oe, struct options *oo, const char *value)
|
const struct options_table_entry *oe, struct options *oo,
|
||||||
|
const char *value)
|
||||||
{
|
{
|
||||||
int key;
|
int key;
|
||||||
|
|
||||||
@ -390,7 +393,8 @@ cmd_set_option_key(unused struct cmd *self, struct cmd_q *cmdq,
|
|||||||
/* Set a colour option. */
|
/* Set a colour option. */
|
||||||
struct options_entry *
|
struct options_entry *
|
||||||
cmd_set_option_colour(unused struct cmd *self, struct cmd_q *cmdq,
|
cmd_set_option_colour(unused struct cmd *self, struct cmd_q *cmdq,
|
||||||
const struct options_table_entry *oe, struct options *oo, const char *value)
|
const struct options_table_entry *oe, struct options *oo,
|
||||||
|
const char *value)
|
||||||
{
|
{
|
||||||
int colour;
|
int colour;
|
||||||
|
|
||||||
@ -405,7 +409,8 @@ cmd_set_option_colour(unused struct cmd *self, struct cmd_q *cmdq,
|
|||||||
/* Set an attributes option. */
|
/* Set an attributes option. */
|
||||||
struct options_entry *
|
struct options_entry *
|
||||||
cmd_set_option_attributes(unused struct cmd *self, struct cmd_q *cmdq,
|
cmd_set_option_attributes(unused struct cmd *self, struct cmd_q *cmdq,
|
||||||
const struct options_table_entry *oe, struct options *oo, const char *value)
|
const struct options_table_entry *oe, struct options *oo,
|
||||||
|
const char *value)
|
||||||
{
|
{
|
||||||
int attr;
|
int attr;
|
||||||
|
|
||||||
@ -420,7 +425,8 @@ cmd_set_option_attributes(unused struct cmd *self, struct cmd_q *cmdq,
|
|||||||
/* Set a flag option. */
|
/* Set a flag option. */
|
||||||
struct options_entry *
|
struct options_entry *
|
||||||
cmd_set_option_flag(unused struct cmd *self, struct cmd_q *cmdq,
|
cmd_set_option_flag(unused struct cmd *self, struct cmd_q *cmdq,
|
||||||
const struct options_table_entry *oe, struct options *oo, const char *value)
|
const struct options_table_entry *oe, struct options *oo,
|
||||||
|
const char *value)
|
||||||
{
|
{
|
||||||
int flag;
|
int flag;
|
||||||
|
|
||||||
|
@ -100,15 +100,17 @@ cmd_show_options_one(struct cmd *self, struct cmd_q *cmdq,
|
|||||||
struct options *oo, int quiet)
|
struct options *oo, int quiet)
|
||||||
{
|
{
|
||||||
struct args *args = self->args;
|
struct args *args = self->args;
|
||||||
|
const char *name = args->argv[0];
|
||||||
const struct options_table_entry *table, *oe;
|
const struct options_table_entry *table, *oe;
|
||||||
struct options_entry *o;
|
struct options_entry *o;
|
||||||
const char *optval;
|
const char *optval;
|
||||||
|
|
||||||
if (*args->argv[0] == '@') {
|
retry:
|
||||||
if ((o = options_find1(oo, args->argv[0])) == NULL) {
|
if (*name == '@') {
|
||||||
|
if ((o = options_find1(oo, name)) == NULL) {
|
||||||
if (quiet)
|
if (quiet)
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
cmdq_error(cmdq, "unknown option: %s", args->argv[0]);
|
cmdq_error(cmdq, "unknown option: %s", name);
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
if (args_has(self->args, 'v'))
|
if (args_has(self->args, 'v'))
|
||||||
@ -119,16 +121,20 @@ cmd_show_options_one(struct cmd *self, struct cmd_q *cmdq,
|
|||||||
}
|
}
|
||||||
|
|
||||||
table = oe = NULL;
|
table = oe = NULL;
|
||||||
if (options_table_find(args->argv[0], &table, &oe) != 0) {
|
if (options_table_find(name, &table, &oe) != 0) {
|
||||||
cmdq_error(cmdq, "ambiguous option: %s", args->argv[0]);
|
cmdq_error(cmdq, "ambiguous option: %s", name);
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
if (oe == NULL) {
|
if (oe == NULL) {
|
||||||
if (quiet)
|
if (quiet)
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
cmdq_error(cmdq, "unknown option: %s", args->argv[0]);
|
cmdq_error(cmdq, "unknown option: %s", name);
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
|
if (oe->style != NULL) {
|
||||||
|
name = oe->style;
|
||||||
|
goto retry;
|
||||||
|
}
|
||||||
if ((o = options_find1(oo, oe->name)) == NULL)
|
if ((o = options_find1(oo, oe->name)) == NULL)
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
optval = options_table_print_entry(oe, o, args_has(self->args, 'v'));
|
optval = options_table_print_entry(oe, o, args_has(self->args, 'v'));
|
||||||
@ -157,6 +163,8 @@ cmd_show_options_all(struct cmd *self, struct cmd_q *cmdq,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (oe = table; oe->name != NULL; oe++) {
|
for (oe = table; oe->name != NULL; oe++) {
|
||||||
|
if (oe->style != NULL)
|
||||||
|
continue;
|
||||||
if ((o = options_find1(oo, oe->name)) == NULL)
|
if ((o = options_find1(oo, oe->name)) == NULL)
|
||||||
continue;
|
continue;
|
||||||
optval = options_table_print_entry(oe, o,
|
optval = options_table_print_entry(oe, o,
|
||||||
|
@ -60,7 +60,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
struct window *w;
|
struct window *w;
|
||||||
struct window_pane *wp, *new_wp = NULL;
|
struct window_pane *wp, *new_wp = NULL;
|
||||||
struct environ env;
|
struct environ env;
|
||||||
const char *cmd, *shell, *template;
|
const char *cmd, *path, *shell, *template;
|
||||||
char *cause, *new_cause, *cp;
|
char *cause, *new_cause, *cp;
|
||||||
u_int hlimit;
|
u_int hlimit;
|
||||||
int size, percentage, cwd, fd = -1;
|
int size, percentage, cwd, fd = -1;
|
||||||
@ -68,6 +68,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
struct layout_cell *lc;
|
struct layout_cell *lc;
|
||||||
struct client *c;
|
struct client *c;
|
||||||
struct format_tree *ft;
|
struct format_tree *ft;
|
||||||
|
struct environ_entry *envent;
|
||||||
|
|
||||||
if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL)
|
if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL)
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
@ -147,8 +148,17 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
new_wp = window_add_pane(w, hlimit);
|
new_wp = window_add_pane(w, hlimit);
|
||||||
|
|
||||||
|
path = NULL;
|
||||||
|
if (cmdq->client != NULL && cmdq->client->session == NULL)
|
||||||
|
envent = environ_find(&cmdq->client->environ, "PATH");
|
||||||
|
else
|
||||||
|
envent = environ_find(&s->environ, "PATH");
|
||||||
|
if (envent != NULL)
|
||||||
|
path = envent->value;
|
||||||
|
|
||||||
if (window_pane_spawn(
|
if (window_pane_spawn(
|
||||||
new_wp, cmd, shell, cwd, &env, s->tio, &cause) != 0)
|
new_wp, cmd, path, shell, cwd, &env, s->tio, &cause) != 0)
|
||||||
goto error;
|
goto error;
|
||||||
layout_assign_pane(lc, new_wp);
|
layout_assign_pane(lc, new_wp);
|
||||||
|
|
||||||
|
@ -71,13 +71,10 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
|
|
||||||
if (args_has(args, 'r')) {
|
if (args_has(args, 'r')) {
|
||||||
if (c->flags & CLIENT_READONLY) {
|
if (c->flags & CLIENT_READONLY)
|
||||||
c->flags &= ~CLIENT_READONLY;
|
c->flags &= ~CLIENT_READONLY;
|
||||||
cmdq_info(cmdq, "made client writable");
|
else
|
||||||
} else {
|
|
||||||
c->flags |= CLIENT_READONLY;
|
c->flags |= CLIENT_READONLY;
|
||||||
cmdq_info(cmdq, "made client read-only");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tflag = args_get(args, 't');
|
tflag = args_get(args, 't');
|
||||||
|
1
cmd.c
1
cmd.c
@ -34,7 +34,6 @@ const struct cmd_entry *cmd_table[] = {
|
|||||||
&cmd_capture_pane_entry,
|
&cmd_capture_pane_entry,
|
||||||
&cmd_choose_buffer_entry,
|
&cmd_choose_buffer_entry,
|
||||||
&cmd_choose_client_entry,
|
&cmd_choose_client_entry,
|
||||||
&cmd_choose_list_entry,
|
|
||||||
&cmd_choose_session_entry,
|
&cmd_choose_session_entry,
|
||||||
&cmd_choose_tree_entry,
|
&cmd_choose_tree_entry,
|
||||||
&cmd_choose_window_entry,
|
&cmd_choose_window_entry,
|
||||||
|
@ -137,7 +137,8 @@ environ_unset(struct environ *env, const char *name)
|
|||||||
* environment.
|
* environment.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
environ_update(const char *vars, struct environ *srcenv, struct environ *dstenv)
|
environ_update(const char *vars, struct environ *srcenv,
|
||||||
|
struct environ *dstenv)
|
||||||
{
|
{
|
||||||
struct environ_entry *envent;
|
struct environ_entry *envent;
|
||||||
char *copyvars, *var, *next;
|
char *copyvars, *var, *next;
|
||||||
|
15
format.c
15
format.c
@ -194,10 +194,10 @@ int
|
|||||||
format_replace(struct format_tree *ft, const char *key, size_t keylen,
|
format_replace(struct format_tree *ft, const char *key, size_t keylen,
|
||||||
char **buf, size_t *len, size_t *off)
|
char **buf, size_t *len, size_t *off)
|
||||||
{
|
{
|
||||||
char *copy, *copy0, *endptr, *ptr, *saved;
|
char *copy, *copy0, *endptr, *ptr, *saved, *trimmed;
|
||||||
const char *value;
|
const char *value;
|
||||||
size_t valuelen;
|
size_t valuelen;
|
||||||
u_long limit = ULONG_MAX;
|
u_long limit = 0;
|
||||||
|
|
||||||
/* Make a copy of the key. */
|
/* Make a copy of the key. */
|
||||||
copy0 = copy = xmalloc(keylen + 1);
|
copy0 = copy = xmalloc(keylen + 1);
|
||||||
@ -256,11 +256,14 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
|
|||||||
value = "";
|
value = "";
|
||||||
saved = NULL;
|
saved = NULL;
|
||||||
}
|
}
|
||||||
valuelen = strlen(value);
|
|
||||||
|
|
||||||
/* Truncate the value if needed. */
|
/* Truncate the value if needed. */
|
||||||
if (valuelen > limit)
|
if (limit != 0) {
|
||||||
valuelen = limit;
|
value = trimmed = utf8_trimcstr(value, limit);
|
||||||
|
free(saved);
|
||||||
|
saved = trimmed;
|
||||||
|
}
|
||||||
|
valuelen = strlen(value);
|
||||||
|
|
||||||
/* Expand the buffer and copy in the value. */
|
/* Expand the buffer and copy in the value. */
|
||||||
while (*len - *off < valuelen + 1) {
|
while (*len - *off < valuelen + 1) {
|
||||||
@ -487,8 +490,6 @@ format_winlink(struct format_tree *ft, struct session *s, struct winlink *wl)
|
|||||||
|
|
||||||
format_add(ft, "window_bell_flag", "%u",
|
format_add(ft, "window_bell_flag", "%u",
|
||||||
!!(wl->flags & WINLINK_BELL));
|
!!(wl->flags & WINLINK_BELL));
|
||||||
format_add(ft, "window_content_flag", "%u",
|
|
||||||
!!(wl->flags & WINLINK_CONTENT));
|
|
||||||
format_add(ft, "window_activity_flag", "%u",
|
format_add(ft, "window_activity_flag", "%u",
|
||||||
!!(wl->flags & WINLINK_ACTIVITY));
|
!!(wl->flags & WINLINK_ACTIVITY));
|
||||||
format_add(ft, "window_silence_flag", "%u",
|
format_add(ft, "window_silence_flag", "%u",
|
||||||
|
@ -131,7 +131,8 @@ grid_view_insert_lines(struct grid *gd, u_int py, u_int ny)
|
|||||||
|
|
||||||
/* Insert lines in region. */
|
/* Insert lines in region. */
|
||||||
void
|
void
|
||||||
grid_view_insert_lines_region(struct grid *gd, u_int rlower, u_int py, u_int ny)
|
grid_view_insert_lines_region(struct grid *gd, u_int rlower, u_int py,
|
||||||
|
u_int ny)
|
||||||
{
|
{
|
||||||
u_int ny2;
|
u_int ny2;
|
||||||
|
|
||||||
@ -160,7 +161,8 @@ grid_view_delete_lines(struct grid *gd, u_int py, u_int ny)
|
|||||||
|
|
||||||
/* Delete lines inside scroll region. */
|
/* Delete lines inside scroll region. */
|
||||||
void
|
void
|
||||||
grid_view_delete_lines_region(struct grid *gd, u_int rlower, u_int py, u_int ny)
|
grid_view_delete_lines_region(struct grid *gd, u_int rlower, u_int py,
|
||||||
|
u_int ny)
|
||||||
{
|
{
|
||||||
u_int ny2;
|
u_int ny2;
|
||||||
|
|
||||||
|
2
grid.c
2
grid.c
@ -624,7 +624,7 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx,
|
|||||||
off += size;
|
off += size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trim) {
|
if (trim) {
|
||||||
while (off > 0 && buf[off - 1] == ' ')
|
while (off > 0 && buf[off - 1] == ' ')
|
||||||
off--;
|
off--;
|
||||||
}
|
}
|
||||||
|
55
input.c
55
input.c
@ -55,6 +55,7 @@ void input_set_state(struct window_pane *, const struct input_transition *);
|
|||||||
|
|
||||||
/* Transition entry/exit handlers. */
|
/* Transition entry/exit handlers. */
|
||||||
void input_clear(struct input_ctx *);
|
void input_clear(struct input_ctx *);
|
||||||
|
void input_ground(struct input_ctx *);
|
||||||
void input_enter_osc(struct input_ctx *);
|
void input_enter_osc(struct input_ctx *);
|
||||||
void input_exit_osc(struct input_ctx *);
|
void input_exit_osc(struct input_ctx *);
|
||||||
void input_enter_apc(struct input_ctx *);
|
void input_enter_apc(struct input_ctx *);
|
||||||
@ -242,7 +243,7 @@ const struct input_transition input_state_utf8_one_table[];
|
|||||||
/* ground state definition. */
|
/* ground state definition. */
|
||||||
const struct input_state input_state_ground = {
|
const struct input_state input_state_ground = {
|
||||||
"ground",
|
"ground",
|
||||||
NULL, NULL,
|
input_ground, NULL,
|
||||||
input_state_ground_table
|
input_state_ground_table
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -701,6 +702,12 @@ input_init(struct window_pane *wp)
|
|||||||
*ictx->param_buf = '\0';
|
*ictx->param_buf = '\0';
|
||||||
ictx->param_len = 0;
|
ictx->param_len = 0;
|
||||||
|
|
||||||
|
ictx->input_space = INPUT_BUF_START;
|
||||||
|
ictx->input_buf = xmalloc(INPUT_BUF_START);
|
||||||
|
|
||||||
|
*ictx->input_buf = '\0';
|
||||||
|
ictx->input_len = 0;
|
||||||
|
|
||||||
ictx->state = &input_state_ground;
|
ictx->state = &input_state_ground;
|
||||||
ictx->flags = 0;
|
ictx->flags = 0;
|
||||||
|
|
||||||
@ -711,8 +718,11 @@ input_init(struct window_pane *wp)
|
|||||||
void
|
void
|
||||||
input_free(struct window_pane *wp)
|
input_free(struct window_pane *wp)
|
||||||
{
|
{
|
||||||
if (wp != NULL)
|
if (wp == NULL)
|
||||||
evbuffer_free(wp->ictx.since_ground);
|
return;
|
||||||
|
|
||||||
|
free(wp->ictx.input_buf);
|
||||||
|
evbuffer_free(wp->ictx.since_ground);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Change input state. */
|
/* Change input state. */
|
||||||
@ -720,14 +730,9 @@ void
|
|||||||
input_set_state(struct window_pane *wp, const struct input_transition *itr)
|
input_set_state(struct window_pane *wp, const struct input_transition *itr)
|
||||||
{
|
{
|
||||||
struct input_ctx *ictx = &wp->ictx;
|
struct input_ctx *ictx = &wp->ictx;
|
||||||
struct evbuffer *ground_evb = ictx->since_ground;
|
|
||||||
|
|
||||||
if (ictx->state->exit != NULL)
|
if (ictx->state->exit != NULL)
|
||||||
ictx->state->exit(ictx);
|
ictx->state->exit(ictx);
|
||||||
|
|
||||||
if (itr->state == &input_state_ground)
|
|
||||||
evbuffer_drain(ground_evb, EVBUFFER_LENGTH(ground_evb));
|
|
||||||
|
|
||||||
ictx->state = itr->state;
|
ictx->state = itr->state;
|
||||||
if (ictx->state->enter != NULL)
|
if (ictx->state->enter != NULL)
|
||||||
ictx->state->enter(ictx);
|
ictx->state->enter(ictx);
|
||||||
@ -882,6 +887,18 @@ input_clear(struct input_ctx *ictx)
|
|||||||
ictx->flags &= ~INPUT_DISCARD;
|
ictx->flags &= ~INPUT_DISCARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Reset for ground state. */
|
||||||
|
void
|
||||||
|
input_ground(struct input_ctx *ictx)
|
||||||
|
{
|
||||||
|
evbuffer_drain(ictx->since_ground, EVBUFFER_LENGTH(ictx->since_ground));
|
||||||
|
|
||||||
|
if (ictx->input_space > INPUT_BUF_START) {
|
||||||
|
ictx->input_space = INPUT_BUF_START;
|
||||||
|
ictx->input_buf = xrealloc(ictx->input_buf, 1, INPUT_BUF_START);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Output this character to the screen. */
|
/* Output this character to the screen. */
|
||||||
int
|
int
|
||||||
input_print(struct input_ctx *ictx)
|
input_print(struct input_ctx *ictx)
|
||||||
@ -924,12 +941,20 @@ input_parameter(struct input_ctx *ictx)
|
|||||||
int
|
int
|
||||||
input_input(struct input_ctx *ictx)
|
input_input(struct input_ctx *ictx)
|
||||||
{
|
{
|
||||||
if (ictx->input_len == (sizeof ictx->input_buf) - 1)
|
size_t available;
|
||||||
ictx->flags |= INPUT_DISCARD;
|
|
||||||
else {
|
available = ictx->input_space;
|
||||||
ictx->input_buf[ictx->input_len++] = ictx->ch;
|
while (ictx->input_len + 1 >= available) {
|
||||||
ictx->input_buf[ictx->input_len] = '\0';
|
available *= 2;
|
||||||
|
if (available > INPUT_BUF_LIMIT) {
|
||||||
|
ictx->flags |= INPUT_DISCARD;
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
ictx->input_buf = xrealloc(ictx->input_buf, 1, available);
|
||||||
|
ictx->input_space = available;
|
||||||
}
|
}
|
||||||
|
ictx->input_buf[ictx->input_len++] = ictx->ch;
|
||||||
|
ictx->input_buf[ictx->input_len] = '\0';
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -1666,8 +1691,8 @@ input_enter_osc(struct input_ctx *ictx)
|
|||||||
void
|
void
|
||||||
input_exit_osc(struct input_ctx *ictx)
|
input_exit_osc(struct input_ctx *ictx)
|
||||||
{
|
{
|
||||||
u_char *p = ictx->input_buf;
|
u_char *p = ictx->input_buf;
|
||||||
int option;
|
int option;
|
||||||
|
|
||||||
if (ictx->flags & INPUT_DISCARD)
|
if (ictx->flags & INPUT_DISCARD)
|
||||||
return;
|
return;
|
||||||
|
2
job.c
2
job.c
@ -59,6 +59,8 @@ job_run(const char *cmd, struct session *s,
|
|||||||
switch (pid = fork()) {
|
switch (pid = fork()) {
|
||||||
case -1:
|
case -1:
|
||||||
environ_free(&env);
|
environ_free(&env);
|
||||||
|
close(out[0]);
|
||||||
|
close(out[1]);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
case 0: /* child */
|
case 0: /* child */
|
||||||
clear_signals(1);
|
clear_signals(1);
|
||||||
|
@ -212,7 +212,7 @@ key_bindings_dispatch(struct key_binding *bd, struct client *c)
|
|||||||
readonly = 0;
|
readonly = 0;
|
||||||
}
|
}
|
||||||
if (!readonly && (c->flags & CLIENT_READONLY)) {
|
if (!readonly && (c->flags & CLIENT_READONLY)) {
|
||||||
cmdq_info(c->cmdq, "client is read-only");
|
cmdq_error(c->cmdq, "client is read-only");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
#include "tmux.h"
|
#include "tmux.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set window layouts - predefined methods to arrange windows. These are one-off
|
* Set window layouts - predefined methods to arrange windows. These are
|
||||||
* and generate a layout tree.
|
* one-off and generate a layout tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void layout_set_even_h(struct window *);
|
void layout_set_even_h(struct window *);
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
* options. These tables are the master copy of the options with their real
|
* options. These tables are the master copy of the options with their real
|
||||||
* (user-visible) types, range limits and default values. At start these are
|
* (user-visible) types, range limits and default values. At start these are
|
||||||
* copied into the runtime global options trees (which only has number and
|
* copied into the runtime global options trees (which only has number and
|
||||||
* string types). These tables are then used to loop up the real type when
|
* string types). These tables are then used to look up the real type when the
|
||||||
* the user sets an option or its value needs to be shown.
|
* user sets an option or its value needs to be shown.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Choice option type lists. */
|
/* Choice option type lists. */
|
||||||
@ -89,7 +89,7 @@ const struct options_table_entry server_options_table[] = {
|
|||||||
|
|
||||||
{ .name = "quiet",
|
{ .name = "quiet",
|
||||||
.type = OPTIONS_TABLE_FLAG,
|
.type = OPTIONS_TABLE_FLAG,
|
||||||
.default_num = 0 /* overridden in main() */
|
.default_num = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
{ .name = "set-clipboard",
|
{ .name = "set-clipboard",
|
||||||
@ -490,11 +490,6 @@ const struct options_table_entry session_options_table[] = {
|
|||||||
.default_num = 0
|
.default_num = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
{ .name = "visual-content",
|
|
||||||
.type = OPTIONS_TABLE_FLAG,
|
|
||||||
.default_num = 0
|
|
||||||
},
|
|
||||||
|
|
||||||
{ .name = "visual-silence",
|
{ .name = "visual-silence",
|
||||||
.type = OPTIONS_TABLE_FLAG,
|
.type = OPTIONS_TABLE_FLAG,
|
||||||
.default_num = 0
|
.default_num = 0
|
||||||
@ -532,7 +527,8 @@ const struct options_table_entry window_options_table[] = {
|
|||||||
|
|
||||||
{ .name = "automatic-rename-format",
|
{ .name = "automatic-rename-format",
|
||||||
.type = OPTIONS_TABLE_STRING,
|
.type = OPTIONS_TABLE_STRING,
|
||||||
.default_str = "#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}"
|
.default_str = "#{?pane_in_mode,[tmux],#{pane_current_command}}"
|
||||||
|
"#{?pane_dead,[dead],}"
|
||||||
},
|
},
|
||||||
|
|
||||||
{ .name = "c0-change-trigger",
|
{ .name = "c0-change-trigger",
|
||||||
@ -628,11 +624,6 @@ const struct options_table_entry window_options_table[] = {
|
|||||||
.default_num = 0
|
.default_num = 0
|
||||||
},
|
},
|
||||||
|
|
||||||
{ .name = "monitor-content",
|
|
||||||
.type = OPTIONS_TABLE_STRING,
|
|
||||||
.default_str = ""
|
|
||||||
},
|
|
||||||
|
|
||||||
{ .name = "monitor-silence",
|
{ .name = "monitor-silence",
|
||||||
.type = OPTIONS_TABLE_NUMBER,
|
.type = OPTIONS_TABLE_NUMBER,
|
||||||
.minimum = 0,
|
.minimum = 0,
|
||||||
@ -734,29 +725,6 @@ const struct options_table_entry window_options_table[] = {
|
|||||||
.style = "window-status-style"
|
.style = "window-status-style"
|
||||||
},
|
},
|
||||||
|
|
||||||
{ .name = "window-status-content-attr",
|
|
||||||
.type = OPTIONS_TABLE_ATTRIBUTES,
|
|
||||||
.default_num = GRID_ATTR_REVERSE,
|
|
||||||
.style = "window-status-content-style"
|
|
||||||
},
|
|
||||||
|
|
||||||
{ .name = "window-status-content-bg",
|
|
||||||
.type = OPTIONS_TABLE_COLOUR,
|
|
||||||
.default_num = 8,
|
|
||||||
.style = "window-status-content-style"
|
|
||||||
},
|
|
||||||
|
|
||||||
{ .name = "window-status-content-fg",
|
|
||||||
.type = OPTIONS_TABLE_COLOUR,
|
|
||||||
.default_num = 8,
|
|
||||||
.style = "window-status-content-style"
|
|
||||||
},
|
|
||||||
|
|
||||||
{ .name = "window-status-content-style",
|
|
||||||
.type = OPTIONS_TABLE_STYLE,
|
|
||||||
.default_str = "reverse"
|
|
||||||
},
|
|
||||||
|
|
||||||
{ .name = "window-status-current-attr",
|
{ .name = "window-status-current-attr",
|
||||||
.type = OPTIONS_TABLE_ATTRIBUTES,
|
.type = OPTIONS_TABLE_ATTRIBUTES,
|
||||||
.default_num = 0,
|
.default_num = 0,
|
||||||
|
@ -99,7 +99,7 @@ osdep_get_name(int fd, char *tty)
|
|||||||
|
|
||||||
retry:
|
retry:
|
||||||
if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) == -1)
|
if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) == -1)
|
||||||
return (NULL);
|
goto error;
|
||||||
len = (len * 5) / 4;
|
len = (len * 5) / 4;
|
||||||
|
|
||||||
if ((newbuf = realloc(buf, len)) == NULL)
|
if ((newbuf = realloc(buf, len)) == NULL)
|
||||||
|
@ -65,7 +65,8 @@ screen_write_reset(struct screen_write_ctx *ctx)
|
|||||||
|
|
||||||
/* Write character. */
|
/* Write character. */
|
||||||
void
|
void
|
||||||
screen_write_putc(struct screen_write_ctx *ctx, struct grid_cell *gc, u_char ch)
|
screen_write_putc(struct screen_write_ctx *ctx, struct grid_cell *gc,
|
||||||
|
u_char ch)
|
||||||
{
|
{
|
||||||
grid_cell_one(gc, ch);
|
grid_cell_one(gc, ch);
|
||||||
screen_write_cell(ctx, gc);
|
screen_write_cell(ctx, gc);
|
||||||
|
@ -118,6 +118,11 @@ server_client_open(struct client *c, char **cause)
|
|||||||
if (c->flags & CLIENT_CONTROL)
|
if (c->flags & CLIENT_CONTROL)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
|
if (strcmp(c->ttyname, "/dev/tty") == 0) {
|
||||||
|
*cause = xstrdup("can't use /dev/tty");
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
if (!(c->flags & CLIENT_TERMINAL)) {
|
if (!(c->flags & CLIENT_TERMINAL)) {
|
||||||
*cause = xstrdup("not a terminal");
|
*cause = xstrdup("not a terminal");
|
||||||
return (-1);
|
return (-1);
|
||||||
|
@ -291,7 +291,8 @@ server_kill_window(struct window *w)
|
|||||||
|
|
||||||
int
|
int
|
||||||
server_link_window(struct session *src, struct winlink *srcwl,
|
server_link_window(struct session *src, struct winlink *srcwl,
|
||||||
struct session *dst, int dstidx, int killflag, int selectflag, char **cause)
|
struct session *dst, int dstidx, int killflag, int selectflag,
|
||||||
|
char **cause)
|
||||||
{
|
{
|
||||||
struct winlink *dstwl;
|
struct winlink *dstwl;
|
||||||
struct session_group *srcsg, *dstsg;
|
struct session_group *srcsg, *dstsg;
|
||||||
|
@ -27,19 +27,16 @@
|
|||||||
int server_window_check_bell(struct session *, struct winlink *);
|
int server_window_check_bell(struct session *, struct winlink *);
|
||||||
int server_window_check_activity(struct session *, struct winlink *);
|
int server_window_check_activity(struct session *, struct winlink *);
|
||||||
int server_window_check_silence(struct session *, struct winlink *);
|
int server_window_check_silence(struct session *, struct winlink *);
|
||||||
int server_window_check_content(
|
|
||||||
struct session *, struct winlink *, struct window_pane *);
|
|
||||||
void ring_bell(struct session *);
|
void ring_bell(struct session *);
|
||||||
|
|
||||||
/* Window functions that need to happen every loop. */
|
/* Window functions that need to happen every loop. */
|
||||||
void
|
void
|
||||||
server_window_loop(void)
|
server_window_loop(void)
|
||||||
{
|
{
|
||||||
struct window *w;
|
struct window *w;
|
||||||
struct winlink *wl;
|
struct winlink *wl;
|
||||||
struct window_pane *wp;
|
struct session *s;
|
||||||
struct session *s;
|
u_int i;
|
||||||
u_int i;
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_LENGTH(&windows); i++) {
|
for (i = 0; i < ARRAY_LENGTH(&windows); i++) {
|
||||||
w = ARRAY_ITEM(&windows, i);
|
w = ARRAY_ITEM(&windows, i);
|
||||||
@ -55,8 +52,6 @@ server_window_loop(void)
|
|||||||
server_window_check_activity(s, wl) ||
|
server_window_check_activity(s, wl) ||
|
||||||
server_window_check_silence(s, wl))
|
server_window_check_silence(s, wl))
|
||||||
server_status_session(s);
|
server_status_session(s);
|
||||||
TAILQ_FOREACH(wp, &w->panes, entry)
|
|
||||||
server_window_check_content(s, wl, wp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,48 +182,6 @@ server_window_check_silence(struct session *s, struct winlink *wl)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for content change in window. */
|
|
||||||
int
|
|
||||||
server_window_check_content(
|
|
||||||
struct session *s, struct winlink *wl, struct window_pane *wp)
|
|
||||||
{
|
|
||||||
struct client *c;
|
|
||||||
struct window *w = wl->window;
|
|
||||||
u_int i;
|
|
||||||
char *found, *ptr;
|
|
||||||
|
|
||||||
/* Activity flag must be set for new content. */
|
|
||||||
if (s->curw->window == w)
|
|
||||||
w->flags &= ~WINDOW_ACTIVITY;
|
|
||||||
|
|
||||||
if (!(w->flags & WINDOW_ACTIVITY) || wl->flags & WINLINK_CONTENT)
|
|
||||||
return (0);
|
|
||||||
if (s->curw == wl && !(s->flags & SESSION_UNATTACHED))
|
|
||||||
return (0);
|
|
||||||
|
|
||||||
ptr = options_get_string(&w->options, "monitor-content");
|
|
||||||
if (ptr == NULL || *ptr == '\0')
|
|
||||||
return (0);
|
|
||||||
if ((found = window_pane_search(wp, ptr, NULL)) == NULL)
|
|
||||||
return (0);
|
|
||||||
free(found);
|
|
||||||
|
|
||||||
if (options_get_number(&s->options, "bell-on-alert"))
|
|
||||||
ring_bell(s);
|
|
||||||
wl->flags |= WINLINK_CONTENT;
|
|
||||||
|
|
||||||
if (options_get_number(&s->options, "visual-content")) {
|
|
||||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
|
||||||
c = ARRAY_ITEM(&clients, i);
|
|
||||||
if (c == NULL || c->session != s)
|
|
||||||
continue;
|
|
||||||
status_message_set(c, "Content in window %u", wl->idx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Ring terminal bell. */
|
/* Ring terminal bell. */
|
||||||
void
|
void
|
||||||
ring_bell(struct session *s)
|
ring_bell(struct session *s)
|
||||||
|
2
server.c
2
server.c
@ -217,7 +217,7 @@ server_loop(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the server should be shutting down (no more clients or sessions). */
|
/* Check if the server should exit (no more clients or sessions). */
|
||||||
int
|
int
|
||||||
server_should_shutdown(void)
|
server_should_shutdown(void)
|
||||||
{
|
{
|
||||||
|
15
session.c
15
session.c
@ -84,8 +84,9 @@ session_find_by_id(u_int id)
|
|||||||
|
|
||||||
/* Create a new session. */
|
/* Create a new session. */
|
||||||
struct session *
|
struct session *
|
||||||
session_create(const char *name, const char *cmd, int cwd, struct environ *env,
|
session_create(const char *name, const char *cmd, const char *path, int cwd,
|
||||||
struct termios *tio, int idx, u_int sx, u_int sy, char **cause)
|
struct environ *env, struct termios *tio, int idx, u_int sx, u_int sy,
|
||||||
|
char **cause)
|
||||||
{
|
{
|
||||||
struct session *s;
|
struct session *s;
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ session_create(const char *name, const char *cmd, int cwd, struct environ *env,
|
|||||||
RB_INSERT(sessions, &sessions, s);
|
RB_INSERT(sessions, &sessions, s);
|
||||||
|
|
||||||
if (cmd != NULL) {
|
if (cmd != NULL) {
|
||||||
if (session_new(s, NULL, cmd, cwd, idx, cause) == NULL) {
|
if (session_new(s, NULL, cmd, path, cwd, idx, cause) == NULL) {
|
||||||
session_destroy(s);
|
session_destroy(s);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -225,8 +226,8 @@ session_previous_session(struct session *s)
|
|||||||
|
|
||||||
/* Create a new window on a session. */
|
/* Create a new window on a session. */
|
||||||
struct winlink *
|
struct winlink *
|
||||||
session_new(struct session *s, const char *name, const char *cmd, int cwd,
|
session_new(struct session *s, const char *name, const char *cmd,
|
||||||
int idx, char **cause)
|
const char *path, int cwd, int idx, char **cause)
|
||||||
{
|
{
|
||||||
struct window *w;
|
struct window *w;
|
||||||
struct winlink *wl;
|
struct winlink *wl;
|
||||||
@ -249,8 +250,8 @@ session_new(struct session *s, const char *name, const char *cmd, int cwd,
|
|||||||
shell = _PATH_BSHELL;
|
shell = _PATH_BSHELL;
|
||||||
|
|
||||||
hlimit = options_get_number(&s->options, "history-limit");
|
hlimit = options_get_number(&s->options, "history-limit");
|
||||||
w = window_create(name, cmd, shell, cwd, &env, s->tio, s->sx, s->sy,
|
w = window_create(name, cmd, path, shell, cwd, &env, s->tio, s->sx,
|
||||||
hlimit, cause);
|
s->sy, hlimit, cause);
|
||||||
if (w == NULL) {
|
if (w == NULL) {
|
||||||
winlink_remove(&s->windows, wl);
|
winlink_remove(&s->windows, wl);
|
||||||
environ_free(&env);
|
environ_free(&env);
|
||||||
|
2
status.c
2
status.c
@ -638,8 +638,6 @@ status_print(
|
|||||||
|
|
||||||
if (wl->flags & WINLINK_BELL)
|
if (wl->flags & WINLINK_BELL)
|
||||||
style_apply_update(gc, oo, "window-status-bell-style");
|
style_apply_update(gc, oo, "window-status-bell-style");
|
||||||
else if (wl->flags & WINLINK_CONTENT)
|
|
||||||
style_apply_update(gc, oo, "window-status-content-style");
|
|
||||||
else if (wl->flags & (WINLINK_ACTIVITY|WINLINK_SILENCE))
|
else if (wl->flags & (WINLINK_ACTIVITY|WINLINK_SILENCE))
|
||||||
style_apply_update(gc, oo, "window-status-activity-style");
|
style_apply_update(gc, oo, "window-status-activity-style");
|
||||||
|
|
||||||
|
77
tmux.1
77
tmux.1
@ -168,10 +168,6 @@ server process to recreate it.
|
|||||||
Behave as a login shell.
|
Behave as a login shell.
|
||||||
This flag currently has no effect and is for compatibility with other shells
|
This flag currently has no effect and is for compatibility with other shells
|
||||||
when using tmux as a login shell.
|
when using tmux as a login shell.
|
||||||
.It Fl q
|
|
||||||
Set the
|
|
||||||
.Ic quiet
|
|
||||||
server option to prevent the server sending various informational messages.
|
|
||||||
.It Fl S Ar socket-path
|
.It Fl S Ar socket-path
|
||||||
Specify a full alternative path to the server socket.
|
Specify a full alternative path to the server socket.
|
||||||
If
|
If
|
||||||
@ -1159,32 +1155,6 @@ flag, see the
|
|||||||
section.
|
section.
|
||||||
This command works only if at least one client is attached.
|
This command works only if at least one client is attached.
|
||||||
.It Xo
|
.It Xo
|
||||||
.Ic choose-list
|
|
||||||
.Op Fl l Ar items
|
|
||||||
.Op Fl t Ar target-window
|
|
||||||
.Op Ar template
|
|
||||||
.Xc
|
|
||||||
Put a window into list choice mode, allowing
|
|
||||||
.Ar items
|
|
||||||
to be selected.
|
|
||||||
.Ar items
|
|
||||||
can be a comma-separated list to display more than one item.
|
|
||||||
If an item has spaces, that entry must be quoted.
|
|
||||||
After an item is chosen,
|
|
||||||
.Ql %%
|
|
||||||
is replaced by the chosen item in the
|
|
||||||
.Ar template
|
|
||||||
and the result is executed as a command.
|
|
||||||
If
|
|
||||||
.Ar template
|
|
||||||
is not given, "run-shell '%%'" is used.
|
|
||||||
.Ar items
|
|
||||||
also accepts format specifiers.
|
|
||||||
For the meaning of this see the
|
|
||||||
.Sx FORMATS
|
|
||||||
section.
|
|
||||||
This command works only if at least one client is attached.
|
|
||||||
.It Xo
|
|
||||||
.Ic choose-session
|
.Ic choose-session
|
||||||
.Op Fl F Ar format
|
.Op Fl F Ar format
|
||||||
.Op Fl t Ar target-window
|
.Op Fl t Ar target-window
|
||||||
@ -2077,9 +2047,7 @@ flag prevents setting an option that is already set.
|
|||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
.Fl q
|
.Fl q
|
||||||
flag suppresses the informational message (as if the
|
flag suppresses errors about unknown options.
|
||||||
.Ic quiet
|
|
||||||
server option was set).
|
|
||||||
.Pp
|
.Pp
|
||||||
With
|
With
|
||||||
.Fl a ,
|
.Fl a ,
|
||||||
@ -2142,12 +2110,6 @@ option.
|
|||||||
Set the number of error or information messages to save in the message log for
|
Set the number of error or information messages to save in the message log for
|
||||||
each client.
|
each client.
|
||||||
The default is 100.
|
The default is 100.
|
||||||
.It Xo Ic quiet
|
|
||||||
.Op Ic on | off
|
|
||||||
.Xc
|
|
||||||
Enable or disable the display of various informational messages (see also the
|
|
||||||
.Fl q
|
|
||||||
command line flag).
|
|
||||||
.It Xo Ic set-clipboard
|
.It Xo Ic set-clipboard
|
||||||
.Op Ic on | off
|
.Op Ic on | off
|
||||||
.Xc
|
.Xc
|
||||||
@ -2577,10 +2539,6 @@ Examples are:
|
|||||||
#[fg=yellow,bold]#(apm -l)%%#[default] [#S]
|
#[fg=yellow,bold]#(apm -l)%%#[default] [#S]
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Where appropriate, special character sequences may be prefixed with a number to
|
|
||||||
specify the maximum length, for example
|
|
||||||
.Ql #24T .
|
|
||||||
.Pp
|
|
||||||
By default, UTF-8 in
|
By default, UTF-8 in
|
||||||
.Ar string
|
.Ar string
|
||||||
is not interpreted, to enable UTF-8, use the
|
is not interpreted, to enable UTF-8, use the
|
||||||
@ -2674,15 +2632,6 @@ through to the terminal (which normally makes a sound).
|
|||||||
Also see the
|
Also see the
|
||||||
.Ic bell-action
|
.Ic bell-action
|
||||||
option.
|
option.
|
||||||
.It Xo Ic visual-content
|
|
||||||
.Op Ic on | off
|
|
||||||
.Xc
|
|
||||||
Like
|
|
||||||
.Ic visual-activity ,
|
|
||||||
display a message when content is present in a window
|
|
||||||
for which the
|
|
||||||
.Ic monitor-content
|
|
||||||
window option is enabled.
|
|
||||||
.It Xo Ic visual-silence
|
.It Xo Ic visual-silence
|
||||||
.Op Ic on | off
|
.Op Ic on | off
|
||||||
.Xc
|
.Xc
|
||||||
@ -2864,14 +2813,6 @@ option.
|
|||||||
Monitor for activity in the window.
|
Monitor for activity in the window.
|
||||||
Windows with activity are highlighted in the status line.
|
Windows with activity are highlighted in the status line.
|
||||||
.Pp
|
.Pp
|
||||||
.It Ic monitor-content Ar match-string
|
|
||||||
Monitor content in the window.
|
|
||||||
When
|
|
||||||
.Xr fnmatch 3
|
|
||||||
pattern
|
|
||||||
.Ar match-string
|
|
||||||
appears in the window, it is highlighted in the status line.
|
|
||||||
.Pp
|
|
||||||
.It Xo Ic monitor-silence
|
.It Xo Ic monitor-silence
|
||||||
.Op Ic interval
|
.Op Ic interval
|
||||||
.Xc
|
.Xc
|
||||||
@ -2944,14 +2885,6 @@ see the
|
|||||||
.Ic message-command-style
|
.Ic message-command-style
|
||||||
option.
|
option.
|
||||||
.Pp
|
.Pp
|
||||||
.It Ic window-status-content-style Ar style
|
|
||||||
Set status line style for windows with a content alert.
|
|
||||||
For how to specify
|
|
||||||
.Ar style ,
|
|
||||||
see the
|
|
||||||
.Ic message-command-style
|
|
||||||
option.
|
|
||||||
.Pp
|
|
||||||
.It Ic window-status-current-format Ar string
|
.It Ic window-status-current-format Ar string
|
||||||
Like
|
Like
|
||||||
.Ar window-status-format ,
|
.Ar window-status-format ,
|
||||||
@ -3155,7 +3088,6 @@ The following variables are available, where appropriate:
|
|||||||
.It Li "window_active" Ta "" Ta "1 if window active"
|
.It Li "window_active" Ta "" Ta "1 if window active"
|
||||||
.It Li "window_activity_flag" Ta "" Ta "1 if window has activity alert"
|
.It Li "window_activity_flag" Ta "" Ta "1 if window has activity alert"
|
||||||
.It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
|
.It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
|
||||||
.It Li "window_content_flag" Ta "" Ta "1 if window has content alert"
|
|
||||||
.It Li "window_find_matches" Ta "" Ta "Matched data from the find-window"
|
.It Li "window_find_matches" Ta "" Ta "Matched data from the find-window"
|
||||||
.It Li "window_flags" Ta "#F" Ta "Window flags"
|
.It Li "window_flags" Ta "#F" Ta "Window flags"
|
||||||
.It Li "window_height" Ta "" Ta "Height of window"
|
.It Li "window_height" Ta "" Ta "Height of window"
|
||||||
@ -3317,18 +3249,15 @@ The flag is one of the following symbols appended to the window name:
|
|||||||
.It Li "-" Ta "Marks the last window (previously selected)."
|
.It Li "-" Ta "Marks the last window (previously selected)."
|
||||||
.It Li "#" Ta "Window is monitored and activity has been detected."
|
.It Li "#" Ta "Window is monitored and activity has been detected."
|
||||||
.It Li "!" Ta "A bell has occurred in the window."
|
.It Li "!" Ta "A bell has occurred in the window."
|
||||||
.It Li "+" Ta "Window is monitored for content and it has appeared."
|
|
||||||
.It Li "~" Ta "The window has been silent for the monitor-silence interval."
|
.It Li "~" Ta "The window has been silent for the monitor-silence interval."
|
||||||
.It Li "Z" Ta "The window's active pane is zoomed."
|
.It Li "Z" Ta "The window's active pane is zoomed."
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The # symbol relates to the
|
The # symbol relates to the
|
||||||
.Ic monitor-activity
|
.Ic monitor-activity
|
||||||
and + to the
|
window option.
|
||||||
.Ic monitor-content
|
|
||||||
window options.
|
|
||||||
The window name is printed in inverted colours if an alert (bell, activity or
|
The window name is printed in inverted colours if an alert (bell, activity or
|
||||||
content) is present.
|
silence) is present.
|
||||||
.Pp
|
.Pp
|
||||||
The colour and attributes of the status line may be configured, the entire
|
The colour and attributes of the status line may be configured, the entire
|
||||||
status line using the
|
status line using the
|
||||||
|
9
tmux.c
9
tmux.c
@ -209,7 +209,7 @@ main(int argc, char **argv)
|
|||||||
char in[256];
|
char in[256];
|
||||||
const char *home;
|
const char *home;
|
||||||
long long pid;
|
long long pid;
|
||||||
int opt, flags, quiet, keys, session;
|
int opt, flags, keys, session;
|
||||||
|
|
||||||
#if defined(DEBUG) && defined(__OpenBSD__)
|
#if defined(DEBUG) && defined(__OpenBSD__)
|
||||||
malloc_options = (char *) "AFGJPX";
|
malloc_options = (char *) "AFGJPX";
|
||||||
@ -217,7 +217,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
setlocale(LC_TIME, "");
|
setlocale(LC_TIME, "");
|
||||||
|
|
||||||
quiet = flags = 0;
|
flags = 0;
|
||||||
label = path = NULL;
|
label = path = NULL;
|
||||||
login_shell = (**argv == '-');
|
login_shell = (**argv == '-');
|
||||||
while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUVv")) != -1) {
|
while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUVv")) != -1) {
|
||||||
@ -250,7 +250,6 @@ main(int argc, char **argv)
|
|||||||
label = xstrdup(optarg);
|
label = xstrdup(optarg);
|
||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
quiet = 1;
|
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
free(path);
|
free(path);
|
||||||
@ -297,11 +296,11 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
options_init(&global_options, NULL);
|
options_init(&global_options, NULL);
|
||||||
options_table_populate_tree(server_options_table, &global_options);
|
options_table_populate_tree(server_options_table, &global_options);
|
||||||
options_set_number(&global_options, "quiet", quiet);
|
|
||||||
|
|
||||||
options_init(&global_s_options, NULL);
|
options_init(&global_s_options, NULL);
|
||||||
options_table_populate_tree(session_options_table, &global_s_options);
|
options_table_populate_tree(session_options_table, &global_s_options);
|
||||||
options_set_string(&global_s_options, "default-shell", "%s", getshell());
|
options_set_string(&global_s_options, "default-shell", "%s",
|
||||||
|
getshell());
|
||||||
|
|
||||||
options_init(&global_w_options, NULL);
|
options_init(&global_w_options, NULL);
|
||||||
options_table_populate_tree(window_options_table, &global_w_options);
|
options_table_populate_tree(window_options_table, &global_w_options);
|
||||||
|
55
tmux.h
55
tmux.h
@ -815,8 +815,11 @@ struct input_ctx {
|
|||||||
u_char param_buf[64];
|
u_char param_buf[64];
|
||||||
size_t param_len;
|
size_t param_len;
|
||||||
|
|
||||||
u_char input_buf[256];
|
#define INPUT_BUF_START 32
|
||||||
|
#define INPUT_BUF_LIMIT 1048576
|
||||||
|
u_char* input_buf;
|
||||||
size_t input_len;
|
size_t input_len;
|
||||||
|
size_t input_space;
|
||||||
|
|
||||||
int param_list[24]; /* -1 not present */
|
int param_list[24]; /* -1 not present */
|
||||||
u_int param_list_len;
|
u_int param_list_len;
|
||||||
@ -987,10 +990,8 @@ struct winlink {
|
|||||||
int flags;
|
int flags;
|
||||||
#define WINLINK_BELL 0x1
|
#define WINLINK_BELL 0x1
|
||||||
#define WINLINK_ACTIVITY 0x2
|
#define WINLINK_ACTIVITY 0x2
|
||||||
#define WINLINK_CONTENT 0x4
|
#define WINLINK_SILENCE 0x4
|
||||||
#define WINLINK_SILENCE 0x8
|
#define WINLINK_ALERTFLAGS (WINLINK_BELL|WINLINK_ACTIVITY|WINLINK_SILENCE)
|
||||||
#define WINLINK_ALERTFLAGS \
|
|
||||||
(WINLINK_BELL|WINLINK_ACTIVITY|WINLINK_CONTENT|WINLINK_SILENCE)
|
|
||||||
|
|
||||||
RB_ENTRY(winlink) entry;
|
RB_ENTRY(winlink) entry;
|
||||||
TAILQ_ENTRY(winlink) sentry;
|
TAILQ_ENTRY(winlink) sentry;
|
||||||
@ -1756,7 +1757,6 @@ extern const struct cmd_entry cmd_break_pane_entry;
|
|||||||
extern const struct cmd_entry cmd_capture_pane_entry;
|
extern const struct cmd_entry cmd_capture_pane_entry;
|
||||||
extern const struct cmd_entry cmd_choose_buffer_entry;
|
extern const struct cmd_entry cmd_choose_buffer_entry;
|
||||||
extern const struct cmd_entry cmd_choose_client_entry;
|
extern const struct cmd_entry cmd_choose_client_entry;
|
||||||
extern const struct cmd_entry cmd_choose_list_entry;
|
|
||||||
extern const struct cmd_entry cmd_choose_session_entry;
|
extern const struct cmd_entry cmd_choose_session_entry;
|
||||||
extern const struct cmd_entry cmd_choose_tree_entry;
|
extern const struct cmd_entry cmd_choose_tree_entry;
|
||||||
extern const struct cmd_entry cmd_choose_window_entry;
|
extern const struct cmd_entry cmd_choose_window_entry;
|
||||||
@ -1851,7 +1851,6 @@ size_t cmd_list_print(struct cmd_list *, char *, size_t);
|
|||||||
struct cmd_q *cmdq_new(struct client *);
|
struct cmd_q *cmdq_new(struct client *);
|
||||||
int cmdq_free(struct cmd_q *);
|
int cmdq_free(struct cmd_q *);
|
||||||
void printflike2 cmdq_print(struct cmd_q *, const char *, ...);
|
void printflike2 cmdq_print(struct cmd_q *, const char *, ...);
|
||||||
void printflike2 cmdq_info(struct cmd_q *, const char *, ...);
|
|
||||||
void printflike2 cmdq_error(struct cmd_q *, const char *, ...);
|
void printflike2 cmdq_error(struct cmd_q *, const char *, ...);
|
||||||
int cmdq_guard(struct cmd_q *, const char *, int);
|
int cmdq_guard(struct cmd_q *, const char *, int);
|
||||||
void cmdq_run(struct cmd_q *, struct cmd_list *);
|
void cmdq_run(struct cmd_q *, struct cmd_list *);
|
||||||
@ -2127,9 +2126,9 @@ void winlink_stack_remove(struct winlink_stack *, struct winlink *);
|
|||||||
int window_index(struct window *, u_int *);
|
int window_index(struct window *, u_int *);
|
||||||
struct window *window_find_by_id(u_int);
|
struct window *window_find_by_id(u_int);
|
||||||
struct window *window_create1(u_int, u_int);
|
struct window *window_create1(u_int, u_int);
|
||||||
struct window *window_create(const char *, const char *, const char *, int,
|
struct window *window_create(const char *, const char *, const char *,
|
||||||
struct environ *, struct termios *, u_int, u_int, u_int,
|
const char *, int, struct environ *, struct termios *,
|
||||||
char **);
|
u_int, u_int, u_int, char **);
|
||||||
void window_destroy(struct window *);
|
void window_destroy(struct window *);
|
||||||
struct window_pane *window_get_active_at(struct window *, u_int, u_int);
|
struct window_pane *window_get_active_at(struct window *, u_int, u_int);
|
||||||
void window_set_active_at(struct window *, u_int, u_int);
|
void window_set_active_at(struct window *, u_int, u_int);
|
||||||
@ -2139,6 +2138,7 @@ struct window_pane *window_add_pane(struct window *, u_int);
|
|||||||
void window_resize(struct window *, u_int, u_int);
|
void window_resize(struct window *, u_int, u_int);
|
||||||
int window_zoom(struct window_pane *);
|
int window_zoom(struct window_pane *);
|
||||||
int window_unzoom(struct window *);
|
int window_unzoom(struct window *);
|
||||||
|
void window_lost_pane(struct window *, struct window_pane *);
|
||||||
void window_remove_pane(struct window *, struct window_pane *);
|
void window_remove_pane(struct window *, struct window_pane *);
|
||||||
struct window_pane *window_pane_at_index(struct window *, u_int);
|
struct window_pane *window_pane_at_index(struct window *, u_int);
|
||||||
struct window_pane *window_pane_next_by_number(struct window *,
|
struct window_pane *window_pane_next_by_number(struct window *,
|
||||||
@ -2153,8 +2153,8 @@ struct window_pane *window_pane_create(struct window *, u_int, u_int, u_int);
|
|||||||
void window_pane_destroy(struct window_pane *);
|
void window_pane_destroy(struct window_pane *);
|
||||||
void window_pane_timer_start(struct window_pane *);
|
void window_pane_timer_start(struct window_pane *);
|
||||||
int window_pane_spawn(struct window_pane *, const char *,
|
int window_pane_spawn(struct window_pane *, const char *,
|
||||||
const char *, int, struct environ *, struct termios *,
|
const char *, const char *, int, struct environ *,
|
||||||
char **);
|
struct termios *, char **);
|
||||||
void window_pane_resize(struct window_pane *, u_int, u_int);
|
void window_pane_resize(struct window_pane *, u_int, u_int);
|
||||||
void window_pane_alternate_on(struct window_pane *,
|
void window_pane_alternate_on(struct window_pane *,
|
||||||
struct grid_cell *, int);
|
struct grid_cell *, int);
|
||||||
@ -2290,7 +2290,7 @@ RB_PROTOTYPE(sessions, session, entry, session_cmp);
|
|||||||
int session_alive(struct session *);
|
int session_alive(struct session *);
|
||||||
struct session *session_find(const char *);
|
struct session *session_find(const char *);
|
||||||
struct session *session_find_by_id(u_int);
|
struct session *session_find_by_id(u_int);
|
||||||
struct session *session_create(const char *, const char *, int,
|
struct session *session_create(const char *, const char *, const char *, int,
|
||||||
struct environ *, struct termios *, int, u_int, u_int,
|
struct environ *, struct termios *, int, u_int, u_int,
|
||||||
char **);
|
char **);
|
||||||
void session_destroy(struct session *);
|
void session_destroy(struct session *);
|
||||||
@ -2298,12 +2298,12 @@ int session_check_name(const char *);
|
|||||||
void session_update_activity(struct session *);
|
void session_update_activity(struct session *);
|
||||||
struct session *session_next_session(struct session *);
|
struct session *session_next_session(struct session *);
|
||||||
struct session *session_previous_session(struct session *);
|
struct session *session_previous_session(struct session *);
|
||||||
struct winlink *session_new(struct session *, const char *, const char *, int,
|
struct winlink *session_new(struct session *, const char *, const char *,
|
||||||
int, char **);
|
const char *, int, int, char **);
|
||||||
struct winlink *session_attach(
|
struct winlink *session_attach(
|
||||||
struct session *, struct window *, int, char **);
|
struct session *, struct window *, int, char **);
|
||||||
int session_detach(struct session *, struct winlink *);
|
int session_detach(struct session *, struct winlink *);
|
||||||
struct winlink* session_has(struct session *, struct window *);
|
struct winlink *session_has(struct session *, struct window *);
|
||||||
int session_next(struct session *, int);
|
int session_next(struct session *, int);
|
||||||
int session_previous(struct session *, int);
|
int session_previous(struct session *, int);
|
||||||
int session_select(struct session *, int);
|
int session_select(struct session *, int);
|
||||||
@ -2319,12 +2319,17 @@ void session_group_synchronize1(struct session *, struct session *);
|
|||||||
void session_renumber_windows(struct session *);
|
void session_renumber_windows(struct session *);
|
||||||
|
|
||||||
/* utf8.c */
|
/* utf8.c */
|
||||||
void utf8_build(void);
|
void utf8_build(void);
|
||||||
int utf8_open(struct utf8_data *, u_char);
|
void utf8_set(struct utf8_data *, u_char);
|
||||||
int utf8_append(struct utf8_data *, u_char);
|
int utf8_open(struct utf8_data *, u_char);
|
||||||
u_int utf8_combine(const struct utf8_data *);
|
int utf8_append(struct utf8_data *, u_char);
|
||||||
u_int utf8_split2(u_int, u_char *);
|
u_int utf8_combine(const struct utf8_data *);
|
||||||
int utf8_strvis(char *, const char *, size_t, int);
|
u_int utf8_split2(u_int, u_char *);
|
||||||
|
int utf8_strvis(char *, const char *, size_t, int);
|
||||||
|
struct utf8_data *utf8_fromcstr(const char *);
|
||||||
|
char *utf8_tocstr(struct utf8_data *);
|
||||||
|
u_int utf8_cstrwidth(const char *);
|
||||||
|
char *utf8_trimcstr(const char *, u_int);
|
||||||
|
|
||||||
/* osdep-*.c */
|
/* osdep-*.c */
|
||||||
char *osdep_get_name(int, char *);
|
char *osdep_get_name(int, char *);
|
||||||
@ -2355,7 +2360,9 @@ const char *style_tostring(struct grid_cell *);
|
|||||||
void style_update_new(struct options *, const char *, const char *);
|
void style_update_new(struct options *, const char *, const char *);
|
||||||
void style_update_old(struct options *, const char *,
|
void style_update_old(struct options *, const char *,
|
||||||
struct grid_cell *);
|
struct grid_cell *);
|
||||||
void style_apply(struct grid_cell *, struct options *, const char *);
|
void style_apply(struct grid_cell *, struct options *,
|
||||||
void style_apply_update(struct grid_cell *, struct options *, const char *);
|
const char *);
|
||||||
|
void style_apply_update(struct grid_cell *, struct options *,
|
||||||
|
const char *);
|
||||||
|
|
||||||
#endif /* TMUX_H */
|
#endif /* TMUX_H */
|
||||||
|
@ -512,7 +512,8 @@ tty_term_ptr1(struct tty_term *term, enum tty_code_code code, const void *a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
tty_term_ptr2(struct tty_term *term, enum tty_code_code code, const void *a, const void *b)
|
tty_term_ptr2(struct tty_term *term, enum tty_code_code code, const void *a,
|
||||||
|
const void *b)
|
||||||
{
|
{
|
||||||
return (tparm((char *) tty_term_string(term, code), a, b, 0, 0, 0, 0, 0, 0, 0));
|
return (tparm((char *) tty_term_string(term, code), a, b, 0, 0, 0, 0, 0, 0, 0));
|
||||||
}
|
}
|
||||||
|
7
tty.c
7
tty.c
@ -388,7 +388,8 @@ tty_putcode_ptr1(struct tty *tty, enum tty_code_code code, const void *a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tty_putcode_ptr2(struct tty *tty, enum tty_code_code code, const void *a, const void *b)
|
tty_putcode_ptr2(struct tty *tty, enum tty_code_code code, const void *a,
|
||||||
|
const void *b)
|
||||||
{
|
{
|
||||||
if (a != NULL && b != NULL)
|
if (a != NULL && b != NULL)
|
||||||
tty_puts(tty, tty_term_ptr2(tty->term, code, a, b));
|
tty_puts(tty, tty_term_ptr2(tty->term, code, a, b));
|
||||||
@ -547,8 +548,8 @@ tty_update_mode(struct tty *tty, int mode, struct screen *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tty_emulate_repeat(
|
tty_emulate_repeat(struct tty *tty, enum tty_code_code code,
|
||||||
struct tty *tty, enum tty_code_code code, enum tty_code_code code1, u_int n)
|
enum tty_code_code code1, u_int n)
|
||||||
{
|
{
|
||||||
if (tty_term_has(tty->term, code))
|
if (tty_term_has(tty->term, code))
|
||||||
tty_putcode1(tty, code, n);
|
tty_putcode1(tty, code, n);
|
||||||
|
122
utf8.c
122
utf8.c
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "tmux.h"
|
#include "tmux.h"
|
||||||
@ -200,6 +201,16 @@ int utf8_overlap(struct utf8_width_entry *, struct utf8_width_entry *);
|
|||||||
u_int utf8_combine(const struct utf8_data *);
|
u_int utf8_combine(const struct utf8_data *);
|
||||||
u_int utf8_width(const struct utf8_data *);
|
u_int utf8_width(const struct utf8_data *);
|
||||||
|
|
||||||
|
/* Set a single character. */
|
||||||
|
void
|
||||||
|
utf8_set(struct utf8_data *utf8data, u_char ch)
|
||||||
|
{
|
||||||
|
*utf8data->data = ch;
|
||||||
|
utf8data->size = 1;
|
||||||
|
|
||||||
|
utf8data->width = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open UTF-8 sequence.
|
* Open UTF-8 sequence.
|
||||||
*
|
*
|
||||||
@ -248,8 +259,7 @@ utf8_append(struct utf8_data *utf8data, u_char ch)
|
|||||||
|
|
||||||
/* Check if two width tree entries overlap. */
|
/* Check if two width tree entries overlap. */
|
||||||
int
|
int
|
||||||
utf8_overlap(
|
utf8_overlap(struct utf8_width_entry *item1, struct utf8_width_entry *item2)
|
||||||
struct utf8_width_entry *item1, struct utf8_width_entry *item2)
|
|
||||||
{
|
{
|
||||||
if (item1->first >= item2->first && item1->first <= item2->last)
|
if (item1->first >= item2->first && item1->first <= item2->last)
|
||||||
return (1);
|
return (1);
|
||||||
@ -394,3 +404,111 @@ utf8_strvis(char *dst, const char *src, size_t len, int flag)
|
|||||||
*dst = '\0';
|
*dst = '\0';
|
||||||
return (dst - start);
|
return (dst - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert a string into a buffer of UTF-8 characters. Terminated by size == 0.
|
||||||
|
* Caller frees.
|
||||||
|
*/
|
||||||
|
struct utf8_data *
|
||||||
|
utf8_fromcstr(const char *src)
|
||||||
|
{
|
||||||
|
struct utf8_data *dst;
|
||||||
|
size_t n;
|
||||||
|
int more;
|
||||||
|
|
||||||
|
dst = NULL;
|
||||||
|
|
||||||
|
n = 0;
|
||||||
|
while (*src != '\0') {
|
||||||
|
dst = xrealloc(dst, n + 1, sizeof *dst);
|
||||||
|
if (utf8_open(&dst[n], *src)) {
|
||||||
|
more = 1;
|
||||||
|
while (*++src != '\0' && more)
|
||||||
|
more = utf8_append(&dst[n], *src);
|
||||||
|
if (!more) {
|
||||||
|
n++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
src -= dst[n].have;
|
||||||
|
}
|
||||||
|
utf8_set(&dst[n], *src);
|
||||||
|
src++;
|
||||||
|
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
|
||||||
|
dst = xrealloc(dst, n + 1, sizeof *dst);
|
||||||
|
dst[n].size = 0;
|
||||||
|
return (dst);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Convert from a buffer of UTF-8 characters into a string. Caller frees. */
|
||||||
|
char *
|
||||||
|
utf8_tocstr(struct utf8_data *src)
|
||||||
|
{
|
||||||
|
char *dst;
|
||||||
|
size_t n;
|
||||||
|
|
||||||
|
dst = NULL;
|
||||||
|
|
||||||
|
n = 0;
|
||||||
|
for(; src->size != 0; src++) {
|
||||||
|
dst = xrealloc(dst, n + src->size, 1);
|
||||||
|
memcpy(dst + n, src->data, src->size);
|
||||||
|
n += src->size;
|
||||||
|
}
|
||||||
|
|
||||||
|
dst = xrealloc(dst, n + 1, 1);
|
||||||
|
dst[n] = '\0';
|
||||||
|
return (dst);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get width of UTF-8 string. */
|
||||||
|
u_int
|
||||||
|
utf8_cstrwidth(const char *s)
|
||||||
|
{
|
||||||
|
struct utf8_data tmp;
|
||||||
|
u_int width;
|
||||||
|
int more;
|
||||||
|
|
||||||
|
width = 0;
|
||||||
|
while (*s != '\0') {
|
||||||
|
if (utf8_open(&tmp, *s)) {
|
||||||
|
more = 1;
|
||||||
|
while (*++s != '\0' && more)
|
||||||
|
more = utf8_append(&tmp, *s);
|
||||||
|
if (!more) {
|
||||||
|
width += tmp.width;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
s -= tmp.have;
|
||||||
|
}
|
||||||
|
width++;
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
return (width);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Trim UTF-8 string to width. Caller frees. */
|
||||||
|
char *
|
||||||
|
utf8_trimcstr(const char *s, u_int width)
|
||||||
|
{
|
||||||
|
struct utf8_data *tmp, *next;
|
||||||
|
char *out;
|
||||||
|
u_int at;
|
||||||
|
|
||||||
|
tmp = utf8_fromcstr(s);
|
||||||
|
|
||||||
|
at = 0;
|
||||||
|
for (next = tmp; next->size != 0; next++) {
|
||||||
|
if (at + next->width > width) {
|
||||||
|
next->size = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
at += next->width;
|
||||||
|
}
|
||||||
|
|
||||||
|
out = utf8_tocstr(tmp);
|
||||||
|
free(tmp);
|
||||||
|
return (out);
|
||||||
|
}
|
||||||
|
@ -715,21 +715,23 @@ window_choose_key(struct window_pane *wp, unused struct session *sess, int key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
window_choose_mouse(
|
window_choose_mouse(struct window_pane *wp, struct session *sess,
|
||||||
struct window_pane *wp, unused struct session *sess, struct mouse_event *m)
|
struct mouse_event *m)
|
||||||
{
|
{
|
||||||
struct window_choose_mode_data *data = wp->modedata;
|
struct window_choose_mode_data *data = wp->modedata;
|
||||||
struct screen *s = &data->screen;
|
struct screen *s = &data->screen;
|
||||||
struct window_choose_mode_item *item;
|
struct window_choose_mode_item *item;
|
||||||
u_int i, idx;
|
u_int idx;
|
||||||
|
|
||||||
if (m->event == MOUSE_EVENT_WHEEL) {
|
if (m->event == MOUSE_EVENT_WHEEL) {
|
||||||
for (i = 0; i < m->scroll; i++) {
|
/*
|
||||||
if (m->wheel == MOUSE_WHEEL_UP)
|
* Don't use m->scroll and just move line-by-line or it's
|
||||||
window_choose_key(wp, sess, KEYC_UP);
|
* annoying.
|
||||||
else
|
*/
|
||||||
window_choose_key(wp, sess, KEYC_DOWN);
|
if (m->wheel == MOUSE_WHEEL_UP)
|
||||||
}
|
window_choose_key(wp, sess, KEYC_UP);
|
||||||
|
else
|
||||||
|
window_choose_key(wp, sess, KEYC_DOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1194,8 +1194,8 @@ window_copy_write_line(
|
|||||||
screen_write_puts(ctx, &gc, "%s", hdr);
|
screen_write_puts(ctx, &gc, "%s", hdr);
|
||||||
} else if (py == last && data->inputtype != WINDOW_COPY_OFF) {
|
} else if (py == last && data->inputtype != WINDOW_COPY_OFF) {
|
||||||
limit = sizeof hdr;
|
limit = sizeof hdr;
|
||||||
if (limit > screen_size_x(s))
|
if (limit > screen_size_x(s) + 1)
|
||||||
limit = screen_size_x(s);
|
limit = screen_size_x(s) + 1;
|
||||||
if (data->inputtype == WINDOW_COPY_NUMERICPREFIX) {
|
if (data->inputtype == WINDOW_COPY_NUMERICPREFIX) {
|
||||||
xoff = size = xsnprintf(hdr, limit,
|
xoff = size = xsnprintf(hdr, limit,
|
||||||
"Repeat: %u", data->numprefix);
|
"Repeat: %u", data->numprefix);
|
||||||
@ -1208,10 +1208,12 @@ window_copy_write_line(
|
|||||||
} else
|
} else
|
||||||
size = 0;
|
size = 0;
|
||||||
|
|
||||||
screen_write_cursormove(ctx, xoff, py);
|
if (size < screen_size_x(s)) {
|
||||||
screen_write_copy(ctx, data->backing, xoff,
|
screen_write_cursormove(ctx, xoff, py);
|
||||||
(screen_hsize(data->backing) - data->oy) + py,
|
screen_write_copy(ctx, data->backing, xoff,
|
||||||
screen_size_x(s) - size, 1);
|
(screen_hsize(data->backing) - data->oy) + py,
|
||||||
|
screen_size_x(s) - size, 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (py == data->cy && data->cx == screen_size_x(s)) {
|
if (py == data->cy && data->cx == screen_size_x(s)) {
|
||||||
memcpy(&gc, &grid_default_cell, sizeof gc);
|
memcpy(&gc, &grid_default_cell, sizeof gc);
|
||||||
@ -2031,7 +2033,8 @@ window_copy_cursor_next_word(struct window_pane *wp, const char *separators)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
window_copy_cursor_next_word_end(struct window_pane *wp, const char *separators)
|
window_copy_cursor_next_word_end(struct window_pane *wp,
|
||||||
|
const char *separators)
|
||||||
{
|
{
|
||||||
struct window_copy_mode_data *data = wp->modedata;
|
struct window_copy_mode_data *data = wp->modedata;
|
||||||
struct options *oo = &wp->window->options;
|
struct options *oo = &wp->window->options;
|
||||||
@ -2082,7 +2085,8 @@ window_copy_cursor_next_word_end(struct window_pane *wp, const char *separators)
|
|||||||
|
|
||||||
/* Move to the previous place where a word begins. */
|
/* Move to the previous place where a word begins. */
|
||||||
void
|
void
|
||||||
window_copy_cursor_previous_word(struct window_pane *wp, const char *separators)
|
window_copy_cursor_previous_word(struct window_pane *wp,
|
||||||
|
const char *separators)
|
||||||
{
|
{
|
||||||
struct window_copy_mode_data *data = wp->modedata;
|
struct window_copy_mode_data *data = wp->modedata;
|
||||||
u_int px, py;
|
u_int px, py;
|
||||||
|
31
window.c
31
window.c
@ -17,13 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/ioctl.h>
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
#include <pwd.h>
|
#include <stdint.h>
|
||||||
#include <signal.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
@ -309,8 +307,8 @@ window_create1(u_int sx, u_int sy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct window *
|
struct window *
|
||||||
window_create(const char *name, const char *cmd, const char *shell,
|
window_create(const char *name, const char *cmd, const char *path,
|
||||||
int cwd, struct environ *env, struct termios *tio,
|
const char *shell, int cwd, struct environ *env, struct termios *tio,
|
||||||
u_int sx, u_int sy, u_int hlimit, char **cause)
|
u_int sx, u_int sy, u_int hlimit, char **cause)
|
||||||
{
|
{
|
||||||
struct window *w;
|
struct window *w;
|
||||||
@ -320,7 +318,8 @@ window_create(const char *name, const char *cmd, const char *shell,
|
|||||||
wp = window_add_pane(w, hlimit);
|
wp = window_add_pane(w, hlimit);
|
||||||
layout_init(w, wp);
|
layout_init(w, wp);
|
||||||
|
|
||||||
if (window_pane_spawn(wp, cmd, shell, cwd, env, tio, cause) != 0) {
|
if (window_pane_spawn(wp, cmd, path, shell, cwd, env, tio,
|
||||||
|
cause) != 0) {
|
||||||
window_destroy(w);
|
window_destroy(w);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -588,7 +587,7 @@ window_add_pane(struct window *w, u_int hlimit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
window_remove_pane(struct window *w, struct window_pane *wp)
|
window_lost_pane(struct window *w, struct window_pane *wp)
|
||||||
{
|
{
|
||||||
if (wp == w->active) {
|
if (wp == w->active) {
|
||||||
w->active = w->last;
|
w->active = w->last;
|
||||||
@ -600,6 +599,12 @@ window_remove_pane(struct window *w, struct window_pane *wp)
|
|||||||
}
|
}
|
||||||
} else if (wp == w->last)
|
} else if (wp == w->last)
|
||||||
w->last = NULL;
|
w->last = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
window_remove_pane(struct window *w, struct window_pane *wp)
|
||||||
|
{
|
||||||
|
window_lost_pane(w, wp);
|
||||||
|
|
||||||
TAILQ_REMOVE(&w->panes, wp, entry);
|
TAILQ_REMOVE(&w->panes, wp, entry);
|
||||||
window_pane_destroy(wp);
|
window_pane_destroy(wp);
|
||||||
@ -696,8 +701,6 @@ window_printable_flags(struct session *s, struct winlink *wl)
|
|||||||
flags[pos++] = '#';
|
flags[pos++] = '#';
|
||||||
if (wl->flags & WINLINK_BELL)
|
if (wl->flags & WINLINK_BELL)
|
||||||
flags[pos++] = '!';
|
flags[pos++] = '!';
|
||||||
if (wl->flags & WINLINK_CONTENT)
|
|
||||||
flags[pos++] = '+';
|
|
||||||
if (wl->flags & WINLINK_SILENCE)
|
if (wl->flags & WINLINK_SILENCE)
|
||||||
flags[pos++] = '~';
|
flags[pos++] = '~';
|
||||||
if (wl == s->curw)
|
if (wl == s->curw)
|
||||||
@ -810,8 +813,9 @@ window_pane_destroy(struct window_pane *wp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
|
window_pane_spawn(struct window_pane *wp, const char *cmd, const char *path,
|
||||||
int cwd, struct environ *env, struct termios *tio, char **cause)
|
const char *shell, int cwd, struct environ *env, struct termios *tio,
|
||||||
|
char **cause)
|
||||||
{
|
{
|
||||||
struct winsize ws;
|
struct winsize ws;
|
||||||
char *argv0, paneid[16];
|
char *argv0, paneid[16];
|
||||||
@ -867,6 +871,8 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
|
|||||||
|
|
||||||
closefrom(STDERR_FILENO + 1);
|
closefrom(STDERR_FILENO + 1);
|
||||||
|
|
||||||
|
if (path != NULL)
|
||||||
|
environ_set(env, "PATH", path);
|
||||||
xsnprintf(paneid, sizeof paneid, "%%%u", wp->id);
|
xsnprintf(paneid, sizeof paneid, "%%%u", wp->id);
|
||||||
environ_set(env, "TMUX_PANE", paneid);
|
environ_set(env, "TMUX_PANE", paneid);
|
||||||
environ_push(env);
|
environ_push(env);
|
||||||
@ -1170,7 +1176,8 @@ window_pane_visible(struct window_pane *wp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
window_pane_search(struct window_pane *wp, const char *searchstr, u_int *lineno)
|
window_pane_search(struct window_pane *wp, const char *searchstr,
|
||||||
|
u_int *lineno)
|
||||||
{
|
{
|
||||||
struct screen *s = &wp->base;
|
struct screen *s = &wp->base;
|
||||||
char *newsearchstr, *line, *msg;
|
char *newsearchstr, *line, *msg;
|
||||||
|
Loading…
Reference in New Issue
Block a user