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
The frontend hardwires the logic to show previous lines + current editable lines.
There's no way for a command to request an input from user, because command is sandboxed from the UI, but the UI is needed to add an editable lines.
Current workaround is that a command must require the user to pass all of the inputs as arguments to the command, which is awkward.
Suggestion
The UI and the command execution should still be decoupled.
The command should be passed some kind of callbacks, like read() and write() to signals that it wants to do I/O.
The UI contains:
Rendering logic (so that the user can read whatever) based on the input it's passed, for example, it should interpret ANSI escape code.
Input logic (so that user can type whatever).
Likely solution: A simulated terminal driver like in Linux terminals.
Input queue: User types -> input goes into input buffer.
Output queue:
The flow:
User types -> Terminal driver interprets (normal characters or special characters like `Ctrl+C`) -> Terminal driver pushes to the input queue (also the output queue for the "input echoing" effect) or sends some signal to the command (how to deal with signals?).
<If a command is running> -> Command performs a `read()` some time -> Take characters from the input queue. -> Command performs a `write()` some time -> Append to the input queue.
The text was updated successfully, but these errors were encountered:
Huy-DNA
changed the title
Feature: Commands should be alble to request input from user.
Feature: Commands should be alble to request input from user
Nov 28, 2024
Huy-DNA
changed the title
Feature: Commands should be alble to request input from user
Feature: Commands should be able to request input from user
Dec 4, 2024
Description
Suggestion
The UI and the command execution should still be decoupled.
The command should be passed some kind of callbacks, like
read()
andwrite()
to signals that it wants to do I/O.The UI contains:
Likely solution: A simulated terminal driver like in Linux terminals.
The flow:
The text was updated successfully, but these errors were encountered: