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

WISH: browser() support redirecting stdout to stderr #90

Open
HenrikBengtsson opened this issue Mar 2, 2019 · 0 comments
Open

WISH: browser() support redirecting stdout to stderr #90

HenrikBengtsson opened this issue Mar 2, 2019 · 0 comments

Comments

@HenrikBengtsson
Copy link
Owner

HenrikBengtsson commented Mar 2, 2019

Issue

base::browser() outputs to standard output (stdout). This causes problem whenever stdout is captured, e.g. by utils::capture.output() or future::future(). For example,

$ R --quiet --vanilla
> foo <- function() browser(); utils::capture.output(foo())
Browse[1]> 1+2
Browse[1]> str(3)
Browse[1]> cat("42\n", file = stderr())
42
Browse[1]> 

Suggestion

Add support for outputting to standard error (stderr), e.g.

browser(file = stderr())

Relevant source code

To the best of my understanding, the browser-related code is in src/main/eval.c. There is not one single location where the output is produced, so adding support for stderr requires changes in multiple locations.

@HenrikBengtsson HenrikBengtsson changed the title WISH: browser() support outputting to stderr WISH: browser() support redirecting stdout to stderr Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant