Check-in [294a0c172c]

Login
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:More formatting tweaking of 160
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 294a0c172cdcb42f5a87656607593c8f07bb20649c92c8754ed32a5159223b84
User & Date: dkf 2019-03-24 17:09:33
Original Comment: More formatting tweaking of 170
Context
2019-03-24
18:47
There is now an implementation of TIP 160, even if it is still partial check-in: 5aba17272d user: dkf tags: trunk
17:09
More formatting tweaking of 160 check-in: 294a0c172c user: dkf tags: trunk
17:06
Update to TIP 160 check-in: 328043ed11 user: dkf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tip/160.md.

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
option will not be defined on serial channels.

# Echo and Cooking Control

Terminals have a number of modes of operation.  Two of the most useful
things that can be set relate to echoing and cooking.

Echoing is fairly simple to understand.  If a terminal has echoing
turned on, every character read is written to the terminal
automatically without any action from the program reading from the
terminal.  Most of the time this is a good thing as people want to
see what they have typed, but sometimes it is not so good.  Examples
include where someone is typing in a password \(when they also want
their lines cooked\) and where an application is being controlled by
single key-presses \(which is a case where neither echoing or cooking
are desirable, with echoing being a problem because the key press is
causing a different set of visible changes in the program's output.\)

Cooking is also fairly simple.  A terminal is producing cooked input
when it is working in simply-editable line-at-a-time mode.  When the
terminal isn't in cooked mode, it delivers raw input directly and
immediately to the program.  Cooked input is the default and is useful
for a lot of purposes, but sometimes \(when the application wants to
use single key-presses to control it\) raw input is definitely
preferable.  Example uses of raw input include text editors \(such as
vi or emacs\) or terminal-based menu systems.

I propose supporting these operation modes within Tcl through a single
new option to the **fconfigure** command \(to definitely be implemented
on Unix serial channels - because that is the type of stdin in a
normal interactive session - and suitably on other platforms if
possible\): **-inputmode**.  This will have three legal values:

 **normal**: This will turn on both echoing and cooking of input, and can
 be considered to be the default configuration for all terminals.

 **password**: This will turn off echoing but leave cooking turned on.

 **raw**: This will turn off both echoing and line-cooking.

I'm not aware off-hand of any use-cases for echoed raw mode.  While
there is theoretically a problem due to cross-talk between channels
\(similar to that which was observed with the rationale for the
**-closemode** option\), it is practically unlikely to be one since
applications that take parsed input from several serial lines are very
rare.






|










|










|
|


|


|

|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
option will not be defined on serial channels.

# Echo and Cooking Control

Terminals have a number of modes of operation.  Two of the most useful
things that can be set relate to echoing and cooking.

_Echoing_ is fairly simple to understand.  If a terminal has echoing
turned on, every character read is written to the terminal
automatically without any action from the program reading from the
terminal.  Most of the time this is a good thing as people want to
see what they have typed, but sometimes it is not so good.  Examples
include where someone is typing in a password \(when they also want
their lines cooked\) and where an application is being controlled by
single key-presses \(which is a case where neither echoing or cooking
are desirable, with echoing being a problem because the key press is
causing a different set of visible changes in the program's output.\)

_Cooking_ is also fairly simple.  A terminal is producing cooked input
when it is working in simply-editable line-at-a-time mode.  When the
terminal isn't in cooked mode, it delivers raw input directly and
immediately to the program.  Cooked input is the default and is useful
for a lot of purposes, but sometimes \(when the application wants to
use single key-presses to control it\) raw input is definitely
preferable.  Example uses of raw input include text editors \(such as
vi or emacs\) or terminal-based menu systems.

I propose supporting these operation modes within Tcl through a single
new option to the **fconfigure** command \(to definitely be implemented
on Unix serial channels  because that is the type of stdin in a
normal interactive session  and suitably on other platforms if
possible\): **-inputmode**.  This will have three legal values:

 * **normal**: This will turn on both echoing and cooking of input, and can
 be considered to be the default configuration for all terminals.

 * **password**: This will turn off echoing but leave cooking turned on.

 * **raw**: This will turn off both echoing and line-cooking.

I'm not aware off-hand of any use-cases for echoed raw mode.  While
there is theoretically a problem due to cross-talk between channels
\(similar to that which was observed with the rationale for the
**-closemode** option\), it is practically unlikely to be one since
applications that take parsed input from several serial lines are very
rare.