fix(tui): 環境変数メニュー再構成 + Esc/Ctrl-C 二重 exit クラッシュ修正#65
Merged
Conversation
devbase list の環境変数メニューが「変数一覧 → スコープ選択 → プロジェクト 選択」と深く、プロジェクトのみ表示は .env 未作成時に何も表示されない問題が あった。メニューを参照・対話系のみに絞り、階層を浅くする。 - 変数一覧はグローバル一覧のみとし、中間プロンプトなしで即実行する - プロジェクト単位の変数一覧は TUI から削除 (CLI で実行) - get / set / delete / export / import を TUI から削除 (CLI で実行。 値の変更は edit ($EDITOR) と project (対話設定) で代替) - 不要になったヘルパ (_collect_assignment / _select_scoped_project / export・import 既定値テーブル) を削除 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
実 TTY で Esc と Ctrl-C をほぼ同時に押す (または Ctrl-C 連打) と 「Return value already set. Application.exit() failed.」のクラッシュ画面が 出る問題を修正する。 Esc バインドは矢印キーのエスケープシーケンスと区別するため eager=False (確定待ち) で登録しており、Esc + Ctrl-C が同一入力バッチで届くと prompt_toolkit は 1 回のキー処理内で「Esc ハンドラ (exit 確定) → 残り バッファ再処理で questionary 組み込み Ctrl-C ハンドラ」を連続実行し、 exit が二重に呼ばれる。process_keys の is_done ガードは入力キューにしか 効かず、この同一バッファ再処理の経路は防げない。 全プロンプト共通の通過点 _ask_erased に _guard_after_done を追加し、 アプリの key_bindings (questionary 組み込み + 後付けの Esc/←) を ConditionalKeyBindings(kb, ~is_done) でラップして回答確定後のキー処理を 無効化する。 pty 回帰テストは Esc+Ctrl-C を 1 回の write で送出して再現する (ガードを 外すと実際にクラッシュ出力を検出して失敗することを確認済み)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
概要
devbase listTUI の改善 2 件(コミット単位で分離):Return value already set. Application.exit() failed.のクラッシュ画面が出る問題を修正関連 Issue
変更点
1. 環境変数メニューの再構成(
a6a1976)新しいメニュー構成:
editとprojectで代替)2. Application.exit() 二重呼び出しの防止(
94859fd)process_keysのis_doneガードは入力キューにしか効かず、この経路は防げない_ask_erasedに_guard_after_doneを追加。アプリの key_bindings をConditionalKeyBindings(kb, ~is_done)でラップし、回答確定後のキー処理を無効化する(確定後の Ctrl-C は無視され、1 回目の操作が正常に効く)動作確認
pytest tests/全 682 件パス(skip 1 件は zsh 未インストールによる補完テストのみ)スクリーンショット・ログ(任意)
補足
RuntimeError: There is no current event loop in thread 'MainThread'は本クラッシュの後始末で出る二次ノイズで、根本原因は同一_ask_erasedが単一の適用点)🤖 Generated with Claude Code