Macaulay2 / Macaulay2/M2

Ctrl+D duplicates persistent readline history

Open
#3,406 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Interpreter
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

Persistent history in terminal sessions as well as vscode using readline now works (#2819, #3403), but there's a minor issue: exiting the terminal with Ctrl+D causes the last item stored in the history to be duplicated. A few possible solutions:
1. delete empty history entries before appending
2. advance `lineNumber` before `exit` and `restart` end the session, then switch to saving `lineNumber-1` lines (so Ctrl+D skips one relatively).

Overall, I've forgotten how Ctrl+D interrupts are caught and handled, so clarity there would be useful.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Ctrl+D interrupts and exits terminal sessions, then follow the persistent readline history save path. Reproduce the issue in a terminal session and compare the history written on Ctrl+D exit with normal session termination; done means the final history item is saved only once.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.