fix: add stty -onlcr to cartesi-init #36
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The expected behavior of the emulator is to pass through new-line control-characters directly from the inside to the outside. On the outside, if the output of the emulator is connected to a file, there should be no addition of a carriage-return. If, however, the output is connected to a terminal, the terminal itself will have been configured to add the carriage-return on its own.
In other words, we expect the following command to have the output shown
Instead, what we see before this PR (but when using a yet-to-be-released kernel linked to opensbi-1.3.1-ctsi-2) is
This is because the terminal inside the emulator is configured with
onlcr
, so it is adding the carriage-return whenever it sees a new-line.The PR configures the terminal with
-onlcr
so this doesn't happen.Interestingly, prior to opensbi-1.3.1-ctsi-2, opensbi itself was adding yet another carriage-return on its own, whenever it saw a new-line sent to the legacy putchar we use with HTIF console. So the output was