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

Detection of color-capable output broken inside an RStudio Job run as a script #121

Closed
mike-lawrence opened this issue Jun 9, 2021 · 1 comment
Labels
bug

Comments

@mike-lawrence
Copy link

@mike-lawrence mike-lawrence commented Jun 9, 2021

It seems that when a job is lauched via rstudioapi::jobRunScript(), any resulting output is not colored by crayon despite it being permitted by the output environment:

#red test works as expected:
jobID = rstudioapi::jobAdd('red')
rstudioapi::jobAddOutput(jobID,crayon::red('red'))

#green test doesn't:
tmp = tempfile()
write(
	'cat(crayon::green("green"))'
	, file = tmp
)
rstudioapi::jobRunScript(tmp,name='green')

#blue test does:
tmp = tempfile()
write(
	'cat("\u001b[34m blue")'
	, file = tmp
)
rstudioapi::jobRunScript(tmp,name='blue')
@gaborcsardi
Copy link
Collaborator

@gaborcsardi gaborcsardi commented Oct 26, 2021

Thanks for the great reproducible example! I believe this was fixed by copying over the new cli ANSI detection: 2b47762

@gaborcsardi gaborcsardi added the bug label Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug
Projects
None yet
Development

No branches or pull requests

2 participants