I am trying to think through how the TTY should work in different circumstances.
Terminology:
Canonical -- if (+) --> means that TTY manages line editing, and after NL (or sometimes CR) is pressed, return bolus of user input.
if (-) --> means that TTY returns each letter as entered, and lets ydb manage line editing.
Echo -- means that the TTY system sends a character, e.g. 'A' to the screen when the types. If enabled, the user can see progress on the screen as they type, though under TTY control.
In addition to above TTY echo settings, YDB can also write out user input to the screen. This functionality is controlled by tt_ptr->term_ctrl, which is a collection of bit flags. The YDB-defined flag TRM_NOECHO controls if YDB should write a copy of what it reads to the screen. "ECHO"/"NOECHO" is also a USE parameter, e.g. USE $P:NOECHO. It is my understanding that if a user specifies NOECHO, that they do not want anything to appear on the screen. Thus ydb should not, itself, write out anything to the screen to compensate for TTY no echo.
In standard ydb, canonical and echo mode were bound together. One of my goals has been to allow separation.
I am going consider the various combinations.
CANONICAL(+) CANONICAL(-)
+---------------------------------+--------------------------------------+
| User typing is shown on screen | As user types, each keystroke |
ECHO(+) | during entry. After completion | is returned to ydb, one at a |
| ydb should NOT show, so needs | time. Because TTY has echo |
| TRM_NOECHO should enabled (+) | enabled, ydb should NOT echo, |
| | so TRM_NOECHO should be enabled(+). |
+---------------------------------+--------------------------------------+
| User typing should NOT be shown | As user types, each keystroke is |
ECHO(-) | on screen (e.g. password input) | returned to ydb. TTY has not put to |
| After completion, ydb also | screen, but since echo(-), ydb should|
| should NOT show, so TRM_NOECHO | NOT write out. |
| should be enabled (+) | Thus TRM_NOECHO should be enabled(+) |
+---------------------------------+--------------------------------------+
NOTE that in every case above, TRM_NOECHO should be (+).
QUESTION: Under what circumstances should TRM_NOECHO be false-- i.e. we DO want ydb do write out to screen? I guess it would be if user wanted to turn OFF TTY echo, but still want something to appear on screen(?). But how would such a circumstance be specified with use parameters??
Anyone have input to this?
Kevin