On Tue, 1 Apr 2025 11:18:14 GMT, Jan Lahoda <jlah...@openjdk.org> wrote:

>> src/jdk.internal.le/share/classes/jdk/internal/console/SimpleConsoleReader.java
>>  line 75:
>> 
>>> 73:                     }
>>> 74:                     continue READ;
>>> 75:                 case '\033':
>> 
>> If this is meant to be platform-agnostic, is it really safe to make these 
>> assumptions about the ability to produce or interpret escape codes and to 
>> make assumptions about their behavior on the user's terminal? I don't think 
>> it would even be safe to assume a single terminal type or interpretation on 
>> POSIX-type OSes; that's what things like `terminfo`/`termcap` are supposed 
>> to be for, right?
>
> In theory, yes, that's what `terminfo` is supposed to do. But `terminfo` has 
> its own set of problems, and what we get from a terminal and what we send to 
> the terminal is so simple and generally supported, that it should be possible 
> to make it work on all realistic terminals(*). Or is there a particular 
> terminal you have in mind?
> 
> (*) I admit I've forgot that `\E[7~`/`\E[8~` is Home/End as well. I'll fix 
> that.

I suppose I don't have a particular terminal in mind. But at the very least, 
maybe some documentation somewhere should reference e.g. 
[ECMA-48](https://ecma-international.org/publications-and-standards/standards/ecma-48/)
 as the basis for the behaviors of the console?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24242#discussion_r2022971819

Reply via email to