-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌠Signal handling #13
Comments
We probably need something like this to make it work without global variables
|
Probably something like this would do the trick: All hail chatgpt
|
To enable canonical mode, you would set the "ICANON" flag using bitwise OR operation. For example, the following code sets the "ICANON" flag and stores the updated termios structure back into the terminal:
To disable canonical mode and enable non-canonical mode, you would clear the "ICANON" flag using bitwise AND operation. For example, the following code clears the "ICANON" flag and stores the updated termios structure back into the terminal:
|
Explanation of Canonical mode In canonical mode, the terminal driver buffers input until a line-ending character is received (usually the Enter key). Once a line-ending character is received, the entire line is returned to the program reading from the terminal. Canonical mode is typically used for command-line interfaces, where the user inputs a command and then presses Enter to execute it. In non-canonical mode, input is not buffered by the terminal driver and is returned to the program as soon as it is received. Non-canonical mode is typically used for applications that require real-time input, such as games or other interactive programs. In canonical mode, various editing features are provided by the terminal driver, such as backspacing and line editing. Non-canonical mode, on the other hand, provides no editing facilities, and it is up to the program to perform any required editing of input. |
Research this page:
I think that for now canonical mode is the normal mode that the shell is in interactive mode
and for example non-canonical mode should be set when the user is in input mode.
Handle ctrl-C, ctrl-D and ctrl-\ which should behave like in bash.
• In interactive mode:
◦ ctrl-C displays a new prompt on a new line. ◦ ctrl-D exits the shell.
◦ ctrl-\ does nothing.
The text was updated successfully, but these errors were encountered: