From 600396a0194eb127b2813e47844801e68e4d2a81 Mon Sep 17 00:00:00 2001
From: Andre Noll <maan@tuebingen.mpg.de>
Date: Wed, 5 May 2021 18:51:35 +0200
Subject: [PATCH] Improve the default command for entering a container.

This is much quicker and avoids the motd.
---
 micoforia.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/micoforia.c b/micoforia.c
index b09f352..6993542 100644
--- a/micoforia.c
+++ b/micoforia.c
@@ -1922,7 +1922,9 @@ static bool com_enter(void)
 	char **argv;
 	char *nsenter_args[] = {"nsenter", "-w", "-a", "-r", "-t"};
 	const unsigned nna = ARRAY_SIZE(nsenter_args); /* num nsenter args */
-	char *dflt_cmd[] = {"login", "-f", "root"};
+	char *dflt_cmd[] = {"bash", "-c", "[[ -f /etc/os-release ]] && "
+		". /etc/os-release && printf '%s\n' \"$PRETTY_NAME\"; "
+		"command cd; exec bash"};
 	unsigned n, N, ni = lls_num_inputs(sublpr);
 	unsigned nea = ni > 1? ni - 1 : ARRAY_SIZE(dflt_cmd); /* num extra args */
 	const char *arg;
-- 
2.39.5