1
0
mirror of https://github.com/google/nomulus synced 2026-07-18 14:02:35 +00:00
Files
nomulus/core
Weimin Yu 542084eb70 Avoid outputting garbage sequences in Nomulus CLI (#3156)
Lazy-initialize the terminal and LineReader in ShellCommand to prevent JLine from eagerly probing terminal capabilities during JCommander command-line startup.

During CLI startup, JCommander instantiates every command (including ShellCommand) to build the CLI's command map. Eager instantiation of the LineReader inside the ShellCommand constructor causes JLine to query the terminal cursor via Device Status Report (DSR) escape sequences. Standard commands (e.g. list_tlds) do not consume stdin, leaving these probing responses (such as ^[[71;1R and 1;1R) in the buffer to be leaked as garbage characters to standard output.

This change defers terminal and LineReader initialization until the shell's run() method is actually executed, while preserving the original constructor for unit tests.

BUG=http://b/534855218
2026-07-15 16:42:18 +00:00
..
2026-04-02 21:23:00 +00:00