I just changed my prompt to be a blue > with
getOption("prompt")
#> [1] "\033[34m> \033[39m"
Which now gives the following output when you try to use reprex
reprex::reprex(input = "x <- 1\n")
Error in grepl(regex, x) :
invalid regular expression '^> ', reason 'Missing ']''
This is because
|
regex <- paste0("^", prompt) |
|
prompts <- grepl(regex, x) |
Does not escape the prompt for special regex characters before passing it to
grepl().
Will have a PR to fix this shortly.