mirror of
https://github.com/tmate-io/tmate.git
synced 2025-04-09 18:31:05 +02:00
Show initial message in copy mode
This commit is contained in:
parent
442143cd90
commit
9781946a70
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();
|
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)
|
void __tmate_status_message(const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
struct client *c;
|
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_client(c, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmate_status_message_session(message);
|
||||||
|
|
||||||
free(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
|
* - While we are parsing the config file, we need to be able to
|
||||||
* serialize it, and so we need a worker encoder.
|
* 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();
|
send_authorized_keys();
|
||||||
tmate_write_ready();
|
tmate_write_ready();
|
||||||
lookup_and_connect();
|
lookup_and_connect();
|
||||||
|
Loading…
Reference in New Issue
Block a user