@tama-create/sf-tools 1.4.0-dev.10 → 1.4.0-dev.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/io/keys.js CHANGED
@@ -164,8 +164,13 @@ export function terminalInput(source = process.stdin, sink = process.stderr, opt
164
164
  sink.write(prompt);
165
165
  const key = await next(raw);
166
166
  // 端末のキー 1 つは画面に出ないので、打った文字を出して改行する
167
- if (raw)
168
- sink.write(key !== null && /^[ -~]$/.test(key) ? `${key}\n` : "\n");
167
+ // プロンプトなしで呼ばれたとき(読み捨ての聞き直し)、文字でないものでは、何も出さない(改行を重ねない)
168
+ if (raw) {
169
+ if (key !== null && /^[ -~]$/.test(key))
170
+ sink.write(`${key}\n`);
171
+ else if (prompt !== "")
172
+ sink.write("\n");
173
+ }
169
174
  return key;
170
175
  },
171
176
  };
@@ -1,6 +1,6 @@
1
1
  // ランチャー(sft を引数なしで、force-* の中で打ったときのメニュー)。phases/start/launcher.sh の移し先(doc/rebuild-design.md 6.1)。
2
2
  // 項目は、サブコマンドの表(menu を持つもの)から作る。番号のキーを押すとすぐ動き(Enter は要らない)、終わるとメニューに戻る。
3
- // q と入力の終わりで終了(0)。範囲外の数字・ほかのキーは聞き直す。Ctrl+C は、メニューの中では無効(誤って閉じない: 6.3)。
3
+ // q と入力の終わりで終了(0)。範囲外の文字は聞き直す。矢印・端末からの通知・Ctrl+C など文字でないものは、黙って読み捨てる(プロンプトを重ねない。Ctrl+C は、メニューの中では無効: 誤って閉じない: 6.3)。
4
4
  // 何も打たずに Enter: メニューを描き直し、裏の判定をやり直す(PR のマージは先端のコミットを変えないため、保存した結果では次の段階に変わらない)。
5
5
  // 判定が動いているあいだの Enter は、描き直すだけ(2 つ同時には動かさない)。
6
6
  // 見出し(core/launcher-status.ts)は、メニューを描くたびに作る。入力を 5 秒ずつ待ち、デバッグログの状態(準備中・取得中)が
@@ -139,8 +139,10 @@ export async function runLauncher(args, box, deps) {
139
139
  const item = n >= 1 && n <= items.length ? items[n - 1] : undefined;
140
140
  if (item)
141
141
  chosen = item;
142
+ else if (/^[ -~]$/.test(key))
143
+ pending = box.input.readKey(prompt); // 範囲外の文字は、打った文字を出して、聞き直す
142
144
  else
143
- pending = box.input.readKey(prompt); // 範囲外・ほかのキー・Ctrl+C は聞き直す
145
+ pending = box.input.readKey(""); // 矢印・端末からの通知・Ctrl+C など、文字でないものは、黙って読み捨てる(プロンプトを重ねない)
144
146
  }
145
147
  if (chosen === null)
146
148
  continue; // Enter: 描き直す
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tama-create/sf-tools",
3
- "version": "1.4.0-dev.10",
3
+ "version": "1.4.0-dev.11",
4
4
  "description": "Salesforce 開発の環境構築と毎日の作業を自動化する(TypeScript 版・開発中)",
5
5
  "license": "Unlicense",
6
6
  "repository": {