Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

REPL History Ghosting: Spurious characters (e.g., 'c') appear when cycling through history via Arrow keys

Aperta
#1,325 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c, javascript
Ambito
cli

Direzione di ricerca

Start by locating the REPL line editor and its history-navigation handling, then reproduce the issue using the listed multi-line input and Up Arrow steps. Check behavior in the reported glibc and musl environments if available. Done means cycling through history no longer adds ghost characters or corrupts the displayed input.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

The REPL line editor fails to properly clear the prompt or calculate cursor position when navigating history with Arrow Keys. This results in "ghost" characters (commonly the letter c) being appended or prepended to the input line. This issue is reproducible across glibc (Fedora, NixOS) and musl (Alpine) environments.

Environment
  • Engine: quickjs-ng (version 0.11.0).
  • Distros: Fedora, NixOS, Alpine (both apk and source build).
Steps to Reproduce
  1. Enter several lines of complex code into the REPL
let b = "    hello  :  1"
b
console.log(`索引 ${index}: '${char}'`);
[...b].forEach((v, i) => {console.log(`${v} ${i}`)})
console.log(`索引 ${index}: '${char}'`);
console.log(1)
console.log(2)
  1. Press the Up Arrow key several times to cycle through the history.
  2. Observe the input line.
Image
Observed Behavior

As you scroll, characters like c (likely remnants of ANSI escape sequences like \x1b[C) begin to leak into the prompt. The line becomes visually corrupted, and the ghost characters do not represent actual code input.

Lingua principale
C
Stelle
3.9k
Fork
389
Merge medio
4g 1h
PR unite (30g)
24

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quickjs-ng/quickjs

Tutte le issue di quickjs-ng/quickjs

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.