examples/lvglterm: Let the shell be named something other than nsh. - #3709
Merged
Merged
Conversation
The terminal spawned "nsh" by a name compiled in, which finds nothing on a system that installs NSH under another name, as a kernel build does when NSH is the system's init: the program is /system/bin/init and no "nsh" exists at all. The terminal came up, took keystrokes, and had no shell behind it. The name is now configurable and still defaults to "nsh", so a bare name is looked up on PATH as before and a path is taken as given. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac>
xiaoxiang781216
approved these changes
Aug 7, 2026
cederom
approved these changes
Aug 7, 2026
simbit18
approved these changes
Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/lvgltermspawned"nsh"by a name compiled in. On a systemthat installs NSH under a different name it finds nothing: the terminal
comes up, takes keystrokes, and has no shell behind it.
program is
/system/bin/initand nonshexists at all.CONFIG_EXAMPLES_LVGLTERM_SHELL, defaulting to"nsh",so existing configurations are unchanged. A bare name is looked up on
PATH as before, and a path is taken as given.
Impact
additively. One new Kconfig string with the previous hardcoded value as
its default.
reproduces the old string exactly.
not from input, and is passed to the same
posix_spawn()as before.NSH is installed under another name; a kernel build with NSH as init is
simply the common way to arrive there.
Testing
I confirm that changes are verified on local setup and works as intended:
15.2.0
upstream), kernel build with NSH as init at
/system/bin/init, LVGL onan HDMI framebuffer with a USB keyboard
Testing logs before change: the terminal starts and accepts keystrokes, but
the spawn finds no such program:
After the change, with
CONFIG_EXAMPLES_LVGLTERM_SHELLset to"/system/bin/init", the shell spawns and its prompt appears in theterminal widget.
Being straight about the evidence on that last point: the terminal renders
into the framebuffer rather than to the serial console, so the result was
confirmed visually on the monitor and there is no console capture to paste.
The board it was confirmed on also carried two local fixes to LVGL's NuttX
driver glue for kernel builds, which are third-party files fetched at build
time and are not part of this PR. Neither is needed for the change here to
be correct: it replaces one compiled-in string with a configurable one whose
default is that same string.
PR verification Self-Check
Claude (claude-opus-5) assisted with diagnosing this and with authoring the
code comment and this PR description. The commit carries an
Assisted-by:tagper CONTRIBUTING.md §1.5.