summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-06-05 10:24:20 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-12-03 14:39:57 +1100
commitb917fc4ec145de2457349bd5df358c89617f1581 (patch)
treeb408b7c49772024348940e484dca7724cc992266
parent1b72d21bc3713b6c82f56e31e84413e0956fa4ed (diff)
downloadtalos-petitboot-b917fc4ec145de2457349bd5df358c89617f1581.zip
talos-petitboot-b917fc4ec145de2457349bd5df358c89617f1581.tar.gz
ui/ncurses: Simplify starting shell
Instead of calling sh twice to echo the 'exiting' message just call sh by itself and leave any welcome message to the shell's interactive config. Also drop the explicit nc_scr_unpost() in cui_run_cmd() since clear() will blank out the screen anyway. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--ui/ncurses/nc-cui.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c
index 0522bdf..474622c 100644
--- a/ui/ncurses/nc-cui.c
+++ b/ui/ncurses/nc-cui.c
@@ -206,31 +206,17 @@ void cui_resize(struct cui *cui)
void cui_on_exit(struct pmenu *menu)
{
struct cui *cui = cui_from_pmenu(menu);
- char *sh_cmd;
cui_cancel_autoboot_on_exit(cui);
- sh_cmd = talloc_asprintf(cui,
- "echo \"Exiting petitboot. Type 'exit' to return.\";\
- echo \"You may run 'pb-sos' to gather diagnostic data\";\
- %s", pb_system_apps.sh);
-
- if (!sh_cmd) {
- pb_log("Failed to allocate shell arguments\n");
- return;
- }
-
const char *argv[] = {
pb_system_apps.sh,
- "-c",
- sh_cmd,
NULL
};
cui_run_cmd(cui, argv);
nc_scr_status_printf(cui->current, _("Returned from shell"));
- talloc_free(sh_cmd);
}
/**
@@ -263,11 +249,9 @@ int cui_run_cmd(struct cui *cui, const char **cmd_argv)
nc_scr_status_printf(cui->current, _("Running %s..."), cmd_argv[0]);
- nc_scr_unpost(cui->current);
+ def_prog_mode();
clear();
refresh();
-
- def_prog_mode();
endwin();
result = process_run_sync(process);
OpenPOWER on IntegriCloud