Tell the host terminal which checkout is on screen so relative links open the right file - #110
Merged
webdevcody merged 1 commit intoSep 30, 2026
Conversation
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.
Contents: 🐛 Symptom · 🔍 Cause · ✅ Fix · 📸 Before / After · 🔁 State ·⚠️ Risk · 🔧 Technical overview · 🧪 Proof · 📝 Notes
🐛 Symptom
Nebula shows many projects in one window, but the terminal around it never knew which one you were looking at. Clicking a relative file link (for example
docs/experiments/2026-09-29-provider-costs/index.html) searched the wrong folder — wherever nebula was launched — and the link broke into a fake website address.🔍 Cause
Nebula never told the host terminal which checkout is on screen. Folder reports from the shell inside are swallowed by the built-in parser, so the host kept its launch folder and resolved every relative link against it. No test looked at the raw bytes the host receives, so nothing caught it.
✅ Fix
cdinside a shell is still not tracked, and sessions over SSH stay silent rather than present a remote path as a local one.📸 Before / After
No screenshots: the change is an invisible terminal code, so the difference is where relative links resolve.
🔁 State
Switch session → host learns the new checkout folder → next switch updates it again → quit restores the launch folder. Before, the host kept the launch folder the whole time.
Verdict: 🟢 Low risk — a few extra bytes to your own terminal, only when the folder actually changed; nothing in the daemon, protocol, or database moves.
Rollback:
git revert <merge>; nothing persisted needs cleanup.🔧 Technical overview
report_working_directoryincrates/nebula-tui/src/event_loop/host_terminal.rs— the UI loop already sent pointer and clipboard codes to the host but never the working folder; now it sends a percent-encoded OSC 7 for the attached checkout.cdinside shells. That would mean tapping the parser on every folder report; checkout-level tracking covers session switches, which is the reported gap.🧪 Proof
host_working_directory_follows_project_switches_and_restores_on_exitincrates/nebula/tests/e2e_tui.rs— fails onupstream/main(no folder bytes after adding a project), passes here.cargo test -p nebula-tui --lib: 1225 passed;cargo check --workspace --all-targetsclean. Fulle2e_tui: the new test plus 8 others pass;nebula_open_from_inside_a_session_raises_the_file_tabsandtui_drag_past_the_pane_top_autoscrolls_and_copies_the_runfail identically on a cleanupstream/maincheckout, so both are pre-existing.📝 Notes
upstream/main; protocol version and database schema untouched.