mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
Sync OpenBSD patchset 304:
Use "Password:" with no space for password prompts and don't display a *s for the password, like pretty much everything else. From martynas@ with minor tweaks by me.
This commit is contained in:
parent
99de03ea32
commit
ce5c441f0f
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server-fn.c,v 1.82 2009-08-31 22:30:15 tcunha Exp $ */
|
/* $Id: server-fn.c,v 1.83 2009-09-02 00:55:49 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -172,7 +172,7 @@ server_lock(void)
|
|||||||
|
|
||||||
status_prompt_clear(c);
|
status_prompt_clear(c);
|
||||||
status_prompt_set(c,
|
status_prompt_set(c,
|
||||||
"Password: ", server_lock_callback, NULL, c, PROMPT_HIDDEN);
|
"Password:", server_lock_callback, NULL, c, PROMPT_HIDDEN);
|
||||||
server_redraw_client(c);
|
server_redraw_client(c);
|
||||||
}
|
}
|
||||||
server_locked = 1;
|
server_locked = 1;
|
||||||
|
26
status.c
26
status.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: status.c,v 1.113 2009-08-31 22:30:15 tcunha Exp $ */
|
/* $Id: status.c,v 1.114 2009-09-02 00:55:49 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -690,7 +690,7 @@ status_prompt_redraw(struct client *c)
|
|||||||
struct screen_write_ctx ctx;
|
struct screen_write_ctx ctx;
|
||||||
struct session *s = c->session;
|
struct session *s = c->session;
|
||||||
struct screen old_status;
|
struct screen old_status;
|
||||||
size_t i, size, left, len, off, n;
|
size_t i, size, left, len, off;
|
||||||
char ch;
|
char ch;
|
||||||
struct grid_cell gc;
|
struct grid_cell gc;
|
||||||
|
|
||||||
@ -724,13 +724,9 @@ status_prompt_redraw(struct client *c)
|
|||||||
left--;
|
left--;
|
||||||
size = left;
|
size = left;
|
||||||
}
|
}
|
||||||
if (c->prompt_flags & PROMPT_HIDDEN) {
|
if (c->prompt_flags & PROMPT_HIDDEN)
|
||||||
n = strlen(c->prompt_buffer);
|
size = 0;
|
||||||
if (n > left)
|
else {
|
||||||
n = left;
|
|
||||||
for (i = 0; i < n; i++)
|
|
||||||
screen_write_putc(&ctx, &gc, '*');
|
|
||||||
} else {
|
|
||||||
screen_write_puts(&ctx, &gc,
|
screen_write_puts(&ctx, &gc,
|
||||||
"%.*s", (int) left, c->prompt_buffer + off);
|
"%.*s", (int) left, c->prompt_buffer + off);
|
||||||
}
|
}
|
||||||
@ -739,17 +735,15 @@ status_prompt_redraw(struct client *c)
|
|||||||
screen_write_putc(&ctx, &gc, ' ');
|
screen_write_putc(&ctx, &gc, ' ');
|
||||||
|
|
||||||
/* Draw a fake cursor. */
|
/* Draw a fake cursor. */
|
||||||
screen_write_cursormove(&ctx, len + c->prompt_index - off, 0);
|
|
||||||
if (c->prompt_index == strlen(c->prompt_buffer))
|
|
||||||
ch = ' ';
|
ch = ' ';
|
||||||
else {
|
|
||||||
if (c->prompt_flags & PROMPT_HIDDEN)
|
if (c->prompt_flags & PROMPT_HIDDEN)
|
||||||
ch = '*';
|
screen_write_cursormove(&ctx, len, 0);
|
||||||
else
|
else {
|
||||||
|
screen_write_cursormove(&ctx,
|
||||||
|
len + c->prompt_index - off, 0);
|
||||||
|
if (c->prompt_index < strlen(c->prompt_buffer))
|
||||||
ch = c->prompt_buffer[c->prompt_index];
|
ch = c->prompt_buffer[c->prompt_index];
|
||||||
}
|
}
|
||||||
if (ch == '\0')
|
|
||||||
ch = ' ';
|
|
||||||
gc.attr ^= GRID_ATTR_REVERSE;
|
gc.attr ^= GRID_ATTR_REVERSE;
|
||||||
screen_write_putc(&ctx, &gc, ch);
|
screen_write_putc(&ctx, &gc, ch);
|
||||||
}
|
}
|
||||||
|
4
tmux.c
4
tmux.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tmux.c,v 1.166 2009-09-02 00:54:00 tcunha Exp $ */
|
/* $Id: tmux.c,v 1.167 2009-09-02 00:55:49 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -223,7 +223,7 @@ prepare_unlock(enum msgtype *msg, void **buf, size_t *len, int argc)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pass = getpass("Password: ")) == NULL)
|
if ((pass = getpass("Password:")) == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
if (strlen(pass) >= sizeof unlockdata.pass) {
|
if (strlen(pass) >= sizeof unlockdata.pass) {
|
||||||
|
Loading…
Reference in New Issue
Block a user