Skip to content
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

kernel: Add possibility to disable prompt redrawing #8763

Conversation

garazdawi
Copy link
Contributor

When stdout is used as both a terminal and as the main logging mechanism, redrawing the prompt will cause a lot of ANSI characters to be printed to the log when the prompt is redrawn. So we add this options for systems that have a hard time migrating away. It is only available in Erlang/OTP 26 as a temporary measure as in the long run no system should be using stdout as a logging mechanism and terminal at the same time.

Supersedes #8644

@garazdawi garazdawi added team:VM Assigned to OTP team VM feature testing currently being tested, tag is used by OTP internal CI labels Aug 30, 2024
@garazdawi garazdawi added this to the OTP-26.2.5.3 milestone Aug 30, 2024
@garazdawi garazdawi self-assigned this Aug 30, 2024
Copy link
Contributor

github-actions bot commented Aug 30, 2024

CT Test Results

    3 files    143 suites   1h 31m 13s ⏱️
3 313 tests 3 026 ✅ 287 💤 0 ❌
3 822 runs  3 485 ✅ 337 💤 0 ❌

Results for commit 49ae08a.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@garazdawi garazdawi removed the testing currently being tested, tag is used by OTP internal CI label Aug 30, 2024
@garazdawi garazdawi force-pushed the lukas/kernel/add-prompt-redraw-option/OTP-19213 branch from b2bf54d to 5dc60f4 Compare September 4, 2024 06:49
When stdout is used as both a terminal and as the main logging
mechanism, redrawing the prompt will cause a lot of ANSI characters
to be printed to the log when the prompt is redrawn. So we add this
options for systems that have a hard time migrating away. It is
only available in Erlang/OTP 26 as a temporary measure as in the long
run no system should be using stdout as a logging mechanism and
terminal at the same time.
@garazdawi garazdawi force-pushed the lukas/kernel/add-prompt-redraw-option/OTP-19213 branch from 5dc60f4 to 49ae08a Compare September 4, 2024 07:09
send_tty(Term2,"my_fun(5) -> ok; my_fun(N) -> timer:sleep(100), io:format(user, \"~p\\n\", [N]), my_fun(N+1).\n"),
send_tty(Term2,"spawn(shell_default, my_fun, [0]). ABC\n"),
timer:sleep(1000),
check_location(Term2, {0,-18}), %% Check that we are at the same location relative to the start.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
check_location(Term2, {0,-18}), %% Check that we are at the same location relative to the start.
check_location(Term2, {0,-18}), %% Check that the prompt is not redrawn, cursor is at the beginning of the line

<p>Sets whether the shell should redraw the prompt when it receives output from other processes.
This setting can be useful if you use <c>run_erl</c> to for logging as redrawing the prompt will
emit a lot of ANSI escape characters that you normally do not want in a log.
The default is <c>true</c>.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation seems somewhat redundant if its only going to be supported in 26. But you should mention that its deprecated / removed in 27?

@garazdawi garazdawi merged commit ba0e816 into erlang:maint-26 Sep 5, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants