Repository navigation
Conversation
Settings > Completion gets "Save command history to disk", on by default. When you turn it off, new commands stay in memory and keep feeding suggestions until Pebrel exits, but nothing is appended to pebrel_history*.jsonl. Saved history still loads, and Clear history remains the way to delete it. One switch covers local, WSL and SSH sessions. nebula_settings stores the command_history_persist key with reset and round-trip tests. nebula_history checks a process-wide flag before appending, and the GPUI app sets that flag at startup and from an observer on the settings global, so open terminals follow the switch at once. The legacy renderer does not apply it. The architecture note records the rejected options: a separate SSH switch, ignoring saved files, and deleting them on toggle. Closes Kuddev#988
The leading-space branch for Kuddev#988 adds its test at the same spot, so both PRs would conflict on merge. Moving this one avoids the rebase.
The GPUI switch test now runs completion_history::init and checks the history write gate after each click, not only the settings global. Both tests that flip the process-wide gate take a shared lock, so they cannot see each other's state when they run in parallel. The note now says that the switch covers command text only: directory_history.json still stores local working directories. It also says that hand edits to the settings file apply at the next start, and it lists both entry points into NebulaHistory::record. Refs Kuddev#988
|
Job: https://github.com/Kuddev/pebrel/actions/runs/43547254984/job/132301544185 What I checked:
|
Kuddev
left a comment
There was a problem hiding this comment.
The history switch works in the isolated storage check: local, WSL, and SSH files stay byte-for-byte unchanged while saving is off, and appending resumes when it is turned back on. The new visible-switch test also passed on the refreshed head.
Please put command_history_persistence_switch_saves_and_drives_the_write_gate in the existing theme-studio nextest group (or use an isolated settings path), and update the CI contract test if the group changes. The new fixture writes and restores the same settings file as the font-size fixture. Its Rust mutex only protects tests in the same process. In Ubuntu CI, the switch test finished while the font-size fixture was running, and that fixture read back 96 instead of the expected 4. The shared path and missing nextest group leave a concrete race even if a rerun passes.
The Intel Mac job separately failed a PowerShell pointer test waiting for an editor report. The history PR does not change that PowerShell code; it still needs a green required check on the corrected head.
…xtures The switch test writes the real settings file. Its Rust mutex only guards tests in the same process, and nextest runs each test in its own process, so on Ubuntu CI it raced the font-size fixture, which read back 96 instead of 4. Add the test to the theme-studio nextest group and pin the entry in the CI contract test.
|
Thanks, you're right. My earlier comment looked only at the macOS run and called the failure unrelated; the Ubuntu failure you linked is a race my test caused. In 19b4341, the switch test joins the The new head needs a green run of the required checks, Intel Mac included. |
|
CI on 19b4341: every required check passes except
Job: https://github.com/Kuddev/pebrel/actions/runs/43707790029/job/132792655996 This test covers application mouse reporting and does not touch command history or settings. The previous Intel Mac run on this PR failed a different test (the PowerShell pointer one you mentioned). The switch test now runs in the Could you re-run the failed Intel Mac job? My account can't. |
Main renamed nebula_app to pebrel_app and nebula_settings to pebrel_settings. Keep both sides of each conflict: the theme-studio filter, the settings save-failure list and the search keywords. Point the note's links and the switch test at the new paths.
Result / 用户结果
Closes #988, together with #990 for part 1 (leading-space commands).
The Completion group in Settings gets a switch, Save command history to disk, on by default. When you turn it off:
pebrel_history.jsonl,pebrel_history_wsl.jsonlorpebrel_history_ssh.jsonl;One switch covers local, WSL and SSH sessions.
This adds a persisted settings key (
command_history_persist). CONTRIBUTING asks for a discussion before a new persisted setting, so I opened this as a draft for that review. The note inarchitecture/notes/pebrel_app/completion/2026-11-14-command-history-persistence.mdrecords the decision and the rejected options: a separate SSH switch, ignoring saved files, and deleting them on toggle.Design / 设计边界
pebrel_settings:command_history_persist, default true, read withbool_on(...).unwrap_or(true)and added to the reset list.nebula_history: a process-wideAtomicBool, starting on, thatappendchecks before opening a file.appendis the only writer of the history files.gpui_shell/completion_history::initsets the flag from the settings global at startup, beforeterminal::init, and updates it from an observer on that global. The Settings pane, reset and backup restore all replace that global.settings_pane.rs:switch_row, override marker, and the save-failure toast.settings.completion.history.persistandpersist_descriptionin the en-US and zh-CN base catalogs, plus search keywords. Other languages fall back to English.directory_history.jsonstill stores the working directories of local terminals. Opt-inPEBREL_DEBUG_LOGstill logs commands topebrel_debug.log.Evidence / 验证依据
mainat 303a7f4 (which renamednebula_apptopebrel_app):cargo test -p pebrel-settings --locked: 110 passed.cargo test --manifest-path tools/i18n-contract/Cargo.toml --locked: 24 passed.cargo test -p pebrel --bin pebrel --features gpui-shell,gpui-test-support --locked -- command_history nebula_history i18n completion_history settings_pane: 154 passed.python scripts/tests/test_ci_native_tests.py: 18 passed.cargo nextestis not installed here;cargo test -- --exacton the full path in the new filter runs the switch test and passes.python scripts/check_architecture.py --base 303a7f4e: passes.pebrel_settings/src/lib.rsgrows by 4 lines, to 1995, and stays under the cap; the new tests live inreset.rs.rustfmt --checkon the changed files: clean.PEBREL_CONFIG_DIRpointing to an empty directory:echo gate-check-offcreated no history file.echo gate-check-onwas appended topebrel_history.jsonl, andgate-check-offwas not in it.command_history_persist=0/=1to the settings file.reset::command_history_persistence_defaults_on_round_trips_and_resets: defaults, invalid values, round trip, reset.nebula_history::disabled_persistence_keeps_new_commands_in_memory_only: with the flag off, a recorded command is suggested but does not reach the SSH history file.command_history_persistence_switch_saves_and_drives_the_write_gate: runs the startup observer, clicks the real switch twice, and checks the saved value, the settings global and the write gate..config/nextest.tomlputs it in thetheme-studiogroup with the other settings fixtures, andscripts/tests/test_ci_native_tests.pychecks that entry.it-IT.jsonhas none of the command-history strings yet.Dark theme, Italian UI (English fallback), switch on
Switch off: reset marker shown
Light theme, Simplified Chinese, switch off
Light theme, Simplified Chinese, switch on
Required Review / 必须确认
CONTRIBUTING.md,docs/architecture.md, anddocs/project-constraints.md.python3 scripts/check_architecture.py --base <PR-base-commit>passes; budgets were not inflated to fit the change.