Bug 12516

Summary: If compiled in, it is impossible to disable cursor position query escape sequence in ash lineedit
Product: Busybox Reporter: Antti Louko <alo>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED INVALID    
Severity: major CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Antti Louko 2020-01-29 07:51:46 UTC
If line editing feature is compiled in busybox, it is imbossible to disable ash to send ESC [ 6n after each prompt in interactive mode.

This is wrong in many ways:

- There are terminals which don't accept ANSI escape sequences.
- It makes is difficult to do sane script talking to ash in a remote device.
- It is not documented properly.
- This is probably against POSIX shell specs.

Ideal solution would be to:

- Make it possible to disable it with a run-time option.
- Automatically detect that the terminal doesn't reply and then disable it automatically.
Comment 1 Denys Vlasenko 2021-06-06 02:58:34 UTC
Disable this config option during build:


config FEATURE_EDITING_ASK_TERMINAL
        bool "Query cursor position from terminal"
        default n
        depends on FEATURE_EDITING
        help
        Allow usage of "ESC [ 6 n" sequence. Terminal answers back with
        current cursor position. This information is used to make line
        editing more robust in some cases.
        If you are not sure whether your terminals respond to this code
        correctly, or want to save on code size (about 400 bytes),
        then do not turn this option on.