You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This request calls for an enhancement to create an option for regurgitating what is typed into the terminal back into it. This method would make it simple to interactively acquire text input directly from the console. kOS already does this when it is consuming commands in interactive mode; however, such functionality cannot be seen in code such as the following naive implementation (I apologize for this being munged):
declare function term_getline { local char is Terminal:INPUT:GETCHAR(). local str is "". until char = Terminal:INPUT:ENTER { set str to str + char. } return str. }
Currently, there are three workarounds to this issue:
A GUI can be constructed to capture the input. This requires loss of focus from the terminal window.
You can print the character that has just been captured, but this implies a newline and will break up the text over several lines without processing things such as backspace (see issue 2522 for a recommendation around this; also, see below)
You can manage the text buffer yourself by using an AT clause with print. This appears to mean taking direct ownership of the text buffer as there is no way to ask the screen where the cursor is currently located, see this for a pull request which may solve the issue).
An argument can be made that a feature request like this is superfluous in light of these workarounds. It would still be useful to the programmer, however, because it alleviates the responsibility of managing the cursor from the client. Additionally, it appears that at one point (or perhaps still) that kOS required that telnet clients do not echo text on behalf of the user, as seen in sec. 4.5.8, pg 60 of this manual from 2016. I don't know if this is still current, but it appears that kOS intended to have full control over this.
The text was updated successfully, but these errors were encountered:
This request calls for an enhancement to create an option for regurgitating what is typed into the terminal back into it. This method would make it simple to interactively acquire text input directly from the console. kOS already does this when it is consuming commands in interactive mode; however, such functionality cannot be seen in code such as the following naive implementation (I apologize for this being munged):
declare function term_getline { local char is Terminal:INPUT:GETCHAR(). local str is "". until char = Terminal:INPUT:ENTER { set str to str + char. } return str. }
Currently, there are three workarounds to this issue:
An argument can be made that a feature request like this is superfluous in light of these workarounds. It would still be useful to the programmer, however, because it alleviates the responsibility of managing the cursor from the client. Additionally, it appears that at one point (or perhaps still) that kOS required that telnet clients do not echo text on behalf of the user, as seen in sec. 4.5.8, pg 60 of this manual from 2016. I don't know if this is still current, but it appears that kOS intended to have full control over this.
The text was updated successfully, but these errors were encountered: