=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-display-menu.c,v retrieving revision 1.34 retrieving revision 1.35 diff -c -r1.34 -r1.35 *** src/usr.bin/tmux/cmd-display-menu.c 2021/10/11 10:55:30 1.34 --- src/usr.bin/tmux/cmd-display-menu.c 2021/10/14 13:19:01 1.35 *************** *** 1,4 **** ! /* $OpenBSD: cmd-display-menu.c,v 1.34 2021/10/11 10:55:30 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-display-menu.c,v 1.35 2021/10/14 13:19:01 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott *************** *** 53,61 **** .name = "display-popup", .alias = "popup", ! .args = { "BCc:d:e:Eh:t:w:x:y:", 0, -1, NULL }, ! .usage = "[-BCE] [-c target-client] [-d start-directory] " ! "[-e environment] [-h height] " CMD_TARGET_PANE_USAGE " " "[-w width] [-x position] [-y position] [shell-command]", .target = { 't', CMD_FIND_PANE, 0 }, --- 53,62 ---- .name = "display-popup", .alias = "popup", ! .args = { "Bb:Cc:d:e:Eh:t:w:x:y:", 0, -1, NULL }, ! .usage = "[-BCE] [-b border-lines] [-c target-client] " ! "[-d start-directory] [-e environment] [-h height] " ! CMD_TARGET_PANE_USAGE " " "[-w width] [-x position] [-y position] [shell-command]", .target = { 't', CMD_FIND_PANE, 0 }, *************** *** 354,364 **** struct client *tc = cmdq_get_target_client(item); struct tty *tty = &tc->tty; const char *value, *shell, *shellcmd = NULL; ! char *cwd, *cause, **argv = NULL; int flags = 0, argc = 0; u_int px, py, w, h, count = args_count(args); struct args_value *av; struct environ *env = NULL; if (args_has(args, 'C')) { server_client_clear_overlay(tc); --- 355,368 ---- struct client *tc = cmdq_get_target_client(item); struct tty *tty = &tc->tty; const char *value, *shell, *shellcmd = NULL; ! char *cwd, *cause = NULL, **argv = NULL; int flags = 0, argc = 0; + enum box_lines lines = BOX_LINES_DEFAULT; u_int px, py, w, h, count = args_count(args); struct args_value *av; struct environ *env = NULL; + struct options *o = s->curw->window->options; + struct options_entry *oe; if (args_has(args, 'C')) { server_client_clear_overlay(tc); *************** *** 394,399 **** --- 398,417 ---- if (!cmd_display_menu_get_position(tc, item, args, &px, &py, w, h)) return (CMD_RETURN_NORMAL); + value = args_get(args, 'b'); + if (args_has(args, 'B')) + lines = BOX_LINES_NONE; + else if (value != NULL) { + oe = options_get(o, "popup-border-lines"); + lines = options_find_choice(options_table_entry(oe), value, + &cause); + if (cause != NULL) { + cmdq_error(item, "popup-border-lines %s", cause); + free(cause); + return (CMD_RETURN_ERROR); + } + } + value = args_get(args, 'd'); if (value != NULL) cwd = format_single_from_target(item, value); *************** *** 425,434 **** flags |= POPUP_CLOSEEXITZERO; else if (args_has(args, 'E')) flags |= POPUP_CLOSEEXIT; ! if (args_has(args, 'B')) ! flags |= POPUP_NOBORDER; ! if (popup_display(flags, item, px, py, w, h, env, shellcmd, argc, argv, ! cwd, tc, s, NULL, NULL) != 0) { cmd_free_argv(argc, argv); if (env != NULL) environ_free(env); --- 443,450 ---- flags |= POPUP_CLOSEEXITZERO; else if (args_has(args, 'E')) flags |= POPUP_CLOSEEXIT; ! if (popup_display(flags, lines, item, px, py, w, h, env, shellcmd, argc, ! argv, cwd, tc, s, NULL, NULL) != 0) { cmd_free_argv(argc, argv); if (env != NULL) environ_free(env);