posit-dev / posit-dev/positron
cat(msg) appends a newline even if 'msg' doesn't have one
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 195
Description
1 - The following works as expected in Positron, RStudio, and terminal R:
> cat("a\n")
a
> cat("\n")
> cat(character(0))
>
2 - The following works as expected in RStudio and terminal R:
> cat("")
>
but in Positron, there's a newline as well;
> cat("")
>
3 - The following works as expected in terminal R:
> cat("a")
a>
but in Positron and RStudio, there's a newline appended as well;
> cat("a")
a
>
Session info
This is with R 4.5.1 running in:
Positron Version: 2025.09.0 build 139
Code - OSS Version: 1.103.0
Commit: 30e3d0a74e09a0f6640929822cb57a326671360e
Date: 2025-08-29T18:34:16.368Z
Electron: 37.2.3
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Linux x64 6.14.0-29-generic
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the examples in Positron with R 4.5.1, comparing cat(""), cat("a"), cat("a\n"), and cat(character(0)) with terminal R and RStudio. Trace the Positron console output handling and identify where the extra newline is introduced; done means output matches the expected R behavior for all four cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, typescript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100