nodejs / nodejs/node

readline: prompt opt-out behavior

オープン
#12,606 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

confirmed-bug help wanted readline
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

  • Version: v8.0.0-rc.0
  • Platform: Windows 4 x64
  • Subsystem: readline

I am not sure if this is a bug or a feature.

Consider this simple echo interface:

'use strict';

const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
});

rl.on('line', (line) => {
  console.log(line);
});

It does not use rl.prompt() anywhere and with a common input there will be no default prompt:

GIF 1:

1


However, if a user press DELETE, BACKSPACE or UP button, default prompt immediately and somehow unexpectedly appears shifting the whole line:

GIF 2:

2


This can be prevented by setting the prompt option into the empty line. However, I am not sure if this opt-out rule is an intended behavior.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、提供されている readline echo インターフェースを Windows 上で実行し、DELETE、BACKSPACE、または UP の後に表示される prompt を再現します。明示的に空の prompt と動作を比較し、その後 readline の入力および prompt 処理のエントリーポイントを調査します。opt-out の動作が定義され、予期しない prompt の動作が修正または文書化されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, nodejs
領域
cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。