Skip to content

Favour new RStudio env vars over existing heuristics #465

Closed

Description

@hadley

rstudio/rstudio#11024

Obviously will want to keep heuristics for some time (probably several years), until this version of RStudio is in widespread usage.

Activity

  1. hadley commented on May 23, 2022

    @hadley
    MemberAuthor

    I think this should fix the problem with the "Run Tests" button in RStudio; currently when it's run cli::is_dynamic_tty() is FALSE so we get a sub-optimal display.

  2. gaborcsardi commented on May 23, 2022

    @gaborcsardi
    Member

    Maybe. OTOH the current detection should also detect the build pane correctly, I believe, so maybe this is not the reason?

  3. romainfrancois commented on May 24, 2022

    @romainfrancois
    Contributor
  4. DavisVaughan commented on May 24, 2022

    @DavisVaughan
    Member

    A few concrete differences between Run Tests on a single file and CMD+SHIFT+T that hopefully can be resolved:

    • Run Tests doesn't have color
    • Run Tests links to files, like test-vec-case-when.R, but doesn't link snapshot_accept()

    I'm on RStudio 2022.06.0-daily+385

    Screen Shot 2022-05-23 at 6 37 16 PM

    Screen Shot 2022-05-24 at 9 12 49 AM

  5. hadley commented on May 24, 2022

    @hadley
    MemberAuthor

    If I install r-lib/rlang#1404 and devtools::document(), I don't see colour working in the build pane either, so I think the current heuristics fail for more than just "Test file".

  6. romainfrancois commented on May 24, 2022

    @romainfrancois
    Contributor

    For the links, I think it's related to the cli.num_colors option used in:

    opt <- as.integer(getOption("cli.num_colors", NULL))[1]
    at least this is what makes it return FALSE

  7. romainfrancois commented on May 24, 2022

    @romainfrancois
    Contributor
  8. added a commit that references this issue on May 27, 2022
    a94e549
  9. gaborcsardi commented on May 27, 2022

    @gaborcsardi
    Member

    @hadley The "Run tests" button wasn't detected with the old methods, I fixed that as well in #471. I probably only looked at the commands in the Build menu....

    @DavisVaughan What does CMD+SHIFT+T run?

  10. DavisVaughan commented on May 27, 2022

    @DavisVaughan
    Member

    @gaborcsardi It runs devtools::test() in the Build pane (which I am fairly certain is in a new R session)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions