Skip to content

Typing :help crashes vimcode in both the TUI and GTK front-ends #596

Description

@JDonaghy

Summary

Typing :help (bare, no topic) in both the TUI and GTK front-ends crashes vimcode.

Repro

  1. Launch vimcode (TUI: cargo run; GTK: cargo run --features gtk / the GTK binary).
  2. From normal mode, press : to enter command mode.
  3. Type help and press Enter.
  4. → vimcode panics / crashes.

Both front-ends are affected, which points at shared engine code rather than a front-end renderer.

Suspected location

Engine::cmd_help in src/core/engine/buffers.rs:1582 handles :help. After building the help text it:

let buf_id = self.buffer_manager.create();
if let Some(state) = self.buffer_manager.get_mut(buf_id) {
    state.buffer.content = ropey::Rope::from_str(&text);
}
self.split_window(SplitDirection::Vertical, None);   // <-- likely crash path
self.active_window_mut().buffer_id = buf_id;

The crash most likely comes from split_window / active_window_mut or from rendering a freshly-created buffer that has no per-window cursor/scroll state (e.g. cursor position out of bounds, unwrap on a missing window/layout entry). :help <topic> may share the same path. Please capture the actual panic message + backtrace (RUST_BACKTRACE=1) and fix the root cause — do not just swallow the panic.

Expected behavior

:help opens the help text in a new split window (a scratch/help buffer) without crashing, matching the existing :help <topic> intent.

Acceptance (black-box test required)

Per CLAUDE.md, ship a black-box regression test that drives the running app and asserts on rendered output:

  • A TUI-harness test (drive :help + Enter through the real event → handle → render path) that asserts no panic and that the help buffer content is visible on screen.
  • If feasible in the same PR, a GTK/offscreen-harness assertion as well; at minimum an engine-level test that execute_command("help") returns without panicking and creates the help buffer + split.

Also verify :help topics, :help keys, :help commands, :help explorer, and an unknown topic (:help bogus) all behave (open buffer or set the "No help for ..." message) without crashing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcoordTracked by coord-tui pipeline

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions