nuttx-apps/nshlib
Yanfeng Liu 31908b3128 nshlib/prompt: extend NSH prompt string management
Currently NSH prompt is defined at build time, thus improper for AMP cases
where the same NSH binary is used on different nodes as the same NSH prompt
shows on all nodes.

This patch attempts to support runtime prompt string population from ordered
sources:
  - the environment variable defined by NSH_PROMPT_ENV plus suffix
  - the NSH_PROMPT_STRING
  - the HOSTNAME plus suffix
The suffix is defined by NSH_PROMPT_SUFFIX so that to clearly separate the
command inputs.

Changes in `nshlib/`

- Kconfig:       add configs NSH_PROMPT_MAX/ENV/SUFFIX etc
- nsh.h:         adjust g_nshprompt defs, add nsh_update_prompt
- nsh_parse.c    relocate g_nshpromt to nsh_prompt.c
- nsh_init.c     revise to use nsh_update_prompt once
- nsh_session.c  revise to use methods in nsh_prompt.c
- Makefile       add nsh_prompt.c
- CMakeLists.txt add nsh_prompt.c

New additions in `nshlib/`

- nsh_prompt.c   prompt related data structures and methods.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-25 00:55:47 -08:00
..
CMakeLists.txt nshlib/prompt: extend NSH prompt string management 2024-02-25 00:55:47 -08:00
Kconfig nshlib/prompt: extend NSH prompt string management 2024-02-25 00:55:47 -08:00
Make.defs Make.defs: Change "ifeq ($(XXX),y)" to "ifneq ($(XXX),) 2022-10-16 14:59:08 +02:00
Makefile nshlib/prompt: extend NSH prompt string management 2024-02-25 00:55:47 -08:00
nsh.h nshlib/prompt: extend NSH prompt string management 2024-02-25 00:55:47 -08:00
nsh_alias.c nsh_alias.c: unalias -a command does not work correctly 2023-09-25 21:05:37 +08:00
nsh_altconsole.c Fix nsh_altconsole.c:152:41: error: implicit declaration of function 'strlen' 2023-09-26 00:31:09 +08:00
nsh_builtin.c Fix nsh_builtin.c:91:22: error: 'SA_NOCLDWAIT' undeclared 2023-02-26 19:02:28 +02:00
nsh_codeccmd.c Update nshlib/nsh_codeccmd.c 2023-09-21 10:48:29 +08:00
nsh_command.c nsh_syscmds: update rptun_ping to rpmsg_ping, add cmd_rpmsg. 2024-01-30 20:42:49 -08:00
nsh_console.c nshlib: disable nsh error print if NSH_DISABLE_ERROR_PRINT enabled 2023-06-12 13:37:27 +08:00
nsh_console.h nshlib/nsh_console.h: Add nsh_none, where any empty output can be forwarded 2023-08-25 17:18:35 +08:00
nsh_consolemain.c nshlib/nsh_consolemain: detect null pointer 2023-08-29 03:11:28 +08:00
nsh_dbgcmds.c nshlib: disable nsh error print if NSH_DISABLE_ERROR_PRINT enabled 2023-06-12 13:37:27 +08:00
nsh_ddcmd.c nshlib: fix build break if CONFIG_CPP_HAVE_VARARGS if undefined 2024-01-30 20:44:05 -08:00
nsh_envcmds.c nshlib: add print negative number support for echo command 2023-07-31 07:58:41 -07:00
nsh_fileapps.c nshlib/nsh_fileapps.c: Remove sched_lock() from nsh_fileapp() 2023-10-26 00:24:58 +08:00
nsh_fscmds.c nsh_fscmds.c: Fix CONFIG_FS_SHM -> CONFIG_FS_SHMFS 2024-01-31 08:52:05 -08:00
nsh_fsutils.c nshlib: Fix static scanning errors 2023-09-08 18:49:31 +08:00
nsh_init.c nshlib/prompt: extend NSH prompt string management 2024-02-25 00:55:47 -08:00
nsh_login.c Replace all strncpy with strlcpy 2023-05-08 21:35:16 +03:00
nsh_mmcmds.c nsh_mmcmds: support "memdump -h/help" to show usage and sequence number 2024-01-06 04:34:27 -08:00
nsh_mntcmds.c apps/nshlib: add the missing FAR macro for all source files 2022-09-22 14:22:13 +08:00
nsh_modcmds.c nshlib: Remove the remaining CONFIG_FILE_STREAM dependence 2023-02-24 17:38:19 +08:00
nsh_netcmds.c nshlib/ifconfig: Let "dns" option depends on CONFIG_NETDB_DNSCLIENT 2023-12-30 01:40:05 -08:00
nsh_parse.c nshlib/prompt: extend NSH prompt string management 2024-02-25 00:55:47 -08:00
nsh_passwdcmds.c apps/nshlib: add the missing FAR macro for all source files 2022-09-22 14:22:13 +08:00
nsh_printf.c nshlib: Remove the remaining CONFIG_FILE_STREAM dependence 2023-02-24 17:38:19 +08:00
nsh_proccmds.c apps/nshlib: Add the pidof command and API nsh_getpid 2023-08-29 02:58:45 +08:00
nsh_prompt.c nshlib/prompt: extend NSH prompt string management 2024-02-25 00:55:47 -08:00
nsh_routecmds.c fsutils/examples: Include unistd.h explicitly 2023-02-05 08:46:59 +02:00
nsh_script.c nshlib: move etc romfs mount from nsh to nuttx 2024-01-09 21:25:19 -08:00
nsh_session.c nshlib/prompt: extend NSH prompt string management 2024-02-25 00:55:47 -08:00
nsh_syscmds.c nshlib/syscmds: guard help mesg for rpmsg ping 2024-02-21 05:31:45 -08:00
nsh_system.c nshlib: Remove the remaining CONFIG_FILE_STREAM dependence 2023-02-24 17:38:19 +08:00
nsh_telnetd.c netutils: Support telnetd in the kernel mode 2022-11-07 15:24:08 +09:00
nsh_telnetlogin.c Replace all strncpy with strlcpy 2023-05-08 21:35:16 +03:00
nsh_test.c nshlib: add negative number logical judgement support for test and [ command 2023-07-30 22:20:02 -07:00
nsh_timcmds.c nsh_timcmds: display date using set format 2024-01-26 19:13:25 -08:00
nsh_usbconsole.c nsh_usbconsole.c: add support for NSH console over a composite device 2023-06-15 03:23:04 +08:00
nsh_usbtrace.c nshlib: Remove the remaining CONFIG_FILE_STREAM dependence 2023-02-24 17:38:19 +08:00
nsh_vars.c Replace all sprintf with snprintf 2023-05-08 21:35:16 +03:00
rc.sysinit.template nsh/script: support rc.sysinit script 2022-04-21 12:54:24 +03:00
rcS.template nsh/script: support rc.sysinit script 2022-04-21 12:54:24 +03:00