Skip to content

Console "remembers" previously run unfinished code #5012

Open

Description

System details:

Windows 11

Positron and OS details:

Positron Version: 2024.10.0 (system setup) build 14
Code - OSS Version: 1.93.0
Commit: 901ab5d
Date: 2024-10-09T15:24:43.348Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

Interpreter details:

R 4.4.1

Describe the issue:

After "unfinished" code (e.g. unclosed bracket) is run and cleared, later codes do not run normally as the console "remembers" the previous unfinished code.

Steps to reproduce the issue:

  1. Start an R document
  2. Enter in document
if (TRUE) {
  print("hello")
# } # deliberately left unclosed
  1. Run the code above in the document with Ctrl/Cmd+Enter
  2. Note that the code is now entered in Console.
  3. Now we realise we made a mistake → clear the console with Ctrl/Cmd+A and Backspace
  4. Fix the code:
if (TRUE) {
  print("hello")
} # now fixed

7.Rerun the code in the document with Ctrl/Cmd+Enter
8. Weird thing happens in console. The code is not run and the console "remembers" the previous code:

>if (TRUE) {
+  print("hello")
+# } # deliberately left unclosed
+
+if (TRUE) {
+  print("hello")
+}

Expected or desired behavior:

The console does not "remember" the wrong code

Were there any error messages in the UI, Output panel, or Developer Tools console?

No

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions