apps: add variable to identify main shell

Change-Id: Ifecfbb58b3c2cdbeae900eb2eeb2b641155a7580
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2021-06-17 22:59:42 +08:00
committed by David Sidrane
parent 55f921841d
commit faa243844d
9 changed files with 34 additions and 20 deletions

View File

@@ -274,7 +274,7 @@ static FAR char *nsh_consolelinebuffer(FAR struct nsh_vtbl_s *vtbl)
#ifndef CONFIG_NSH_DISABLEBG
static FAR struct nsh_vtbl_s *nsh_consoleclone(FAR struct nsh_vtbl_s *vtbl)
{
FAR struct console_stdio_s *pclone = nsh_newconsole();
FAR struct console_stdio_s *pclone = nsh_newconsole(vtbl->isctty);
return &pclone->cn_vtbl;
}
#endif
@@ -436,7 +436,7 @@ static void nsh_consoleexit(FAR struct nsh_vtbl_s *vtbl, int exitstatus)
* Name: nsh_newconsole
****************************************************************************/
FAR struct console_stdio_s *nsh_newconsole(void)
FAR struct console_stdio_s *nsh_newconsole(bool isctty)
{
FAR struct console_stdio_s *pstate =
(FAR struct console_stdio_s *)zalloc(sizeof(struct console_stdio_s));
@@ -454,6 +454,7 @@ FAR struct console_stdio_s *nsh_newconsole(void)
pstate->cn_vtbl.error = nsh_erroroutput;
pstate->cn_vtbl.linebuffer = nsh_consolelinebuffer;
pstate->cn_vtbl.exit = nsh_consoleexit;
pstate->cn_vtbl.isctty = isctty;
#ifndef CONFIG_NSH_DISABLESCRIPT
/* Set the initial option flags */