positron icon indicating copy to clipboard operation
positron copied to clipboard

Debugging sessions should have independent console history

Open jmcphers opened this issue 1 year ago • 3 comments

System details:

Positron and OS details:

Positron Version: 2024.08.0 (Universal) build 48
Code - OSS Version: 1.91.0
Commit: ed616b36655fb24d116108bdd833f1321704315b
Date: 2024-08-19T04:26:51.868Z
Electron: 29.4.0
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0

Interpreter details:

R 4.2.3

Describe the issue:

Console history is recorded when inside a debug session.

Steps to reproduce the issue:

Enter the R debugger, then execute a few statements. Exit the debugger, then press Up a few times. The statements that were executed inside the debug session leak into the main console history.

image

(May also be an issue in Python)

Expected or desired behavior:

The statements executed inside the debugger often reference values or commands (e.g. Q in the example above) that are not part of the main session, so they shouldn't get added to the console history.

Note that this doesn't mean we should turn off console history for the debugger, as within a debug session you still want history navigation to work to replay previous debug commands.

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

Nope.

jmcphers avatar Aug 26 '24 15:08 jmcphers

I think (though I haven't investigated thoroughly) that the Python equivalent is #1632, which is sort of the opposite problem (debug prompts have no history at all).

jmcphers avatar Aug 26 '24 15:08 jmcphers

Just to add some color, the concrete form this annoyance takes for me is my recent history just consisting of n over and over again.

jennybc avatar Aug 26 '24 22:08 jennybc

Requested in discussions here: https://github.com/posit-dev/positron/discussions/4841

jmcphers avatar Sep 27 '24 22:09 jmcphers

Hello, sorry for the "bump"-like comment but is there an expected timeline for fixing this bug? It makes the debugging experience with browser() very annoying.

etiennebacher avatar Jan 21 '25 18:01 etiennebacher

It is super annoying, yep! 😔 I'll be transparent that although we do plan to invest more in the debugger over the next few months, this issue has been identified as more "nice to have" than a few more urgent problems (examples include #3001 and #3151). Unfortunately I don't think we can commit that we'll get to this one in short order.

juliasilge avatar Jan 22 '25 00:01 juliasilge

A minimal change that would at least be an improvement would be to not store the debug session commands in the history.

juliasilge avatar Dec 04 '25 16:12 juliasilge

Verified Fixed

Positron Version(s) : 2026.01.0 build 128
OS Version          : macOS Tahoe 26.1

Test scenario(s)

Thank you for the details, @jmcphers. Very helpful.

  • Console mode (R and Python)

    • Enter a few commands
    • Up/Down recalls only console history
  • Debug mode (R and Python)

    • Start debugging
    • Enter a few commands
    • Up/Down recalls only debug history
  • Separation

    • Debug commands not shown in console
    • Console commands not shown in debug
  • Mode switch

    • Start or stop debugging
    • History switches accordingly
  • Known limitation: Multiple sessions share active debug state*

Note*: if this becomes an issue, more nuanced fix can be addressed as part of new issue/PR.

rodrigosf672 avatar Dec 19 '25 18:12 rodrigosf672