mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-22 18:14:09 +00:00
Show initial message in copy mode
This commit is contained in:
parent
442143cd90
commit
9781946a70
2 changed files with 25 additions and 0 deletions
20
tmate-msg.c
20
tmate-msg.c
|
|
@ -50,6 +50,24 @@ static void tmate_status_message_client(struct client *c, const char *message)
|
|||
recalculate_sizes();
|
||||
}
|
||||
|
||||
static void tmate_status_message_session(const char *message)
|
||||
{
|
||||
if (tmate_foreground)
|
||||
return;
|
||||
|
||||
struct session *s;
|
||||
s = RB_MIN(sessions, &sessions);
|
||||
if (!s) {
|
||||
cfg_add_cause("%s", message);
|
||||
return;
|
||||
}
|
||||
|
||||
struct window_pane *wp;
|
||||
wp = s->curw->window->active;
|
||||
if (wp->mode == &window_copy_mode)
|
||||
window_copy_add(wp, "%s", message);
|
||||
}
|
||||
|
||||
void __tmate_status_message(const char *fmt, va_list ap)
|
||||
{
|
||||
struct client *c;
|
||||
|
|
@ -63,6 +81,8 @@ void __tmate_status_message(const char *fmt, va_list ap)
|
|||
tmate_status_message_client(c, message);
|
||||
}
|
||||
|
||||
tmate_status_message_session(message);
|
||||
|
||||
free(message);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -190,6 +190,11 @@ void tmate_session_start(void)
|
|||
* - While we are parsing the config file, we need to be able to
|
||||
* serialize it, and so we need a worker encoder.
|
||||
*/
|
||||
if (!tmate_foreground) {
|
||||
cfg_add_cause("%s", "To see these messages again, run: tmate show-messages");
|
||||
cfg_add_cause("%s", "-----------------------------------------------------");
|
||||
}
|
||||
|
||||
send_authorized_keys();
|
||||
tmate_write_ready();
|
||||
lookup_and_connect();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue