tui: e edits the file in $EDITOR, x opens it with the system - #42
Merged
Merged
Conversation
The viewer shows what it can; for the rest the answer is the program the system already has. `e` opens the file under the cursor in $VISUAL, then $EDITOR, then vim/nvim/nano/vi — a remote file is edited on the server over `ssh -t` with the editor the server has. `x` hands a file to the desktop opener when there is a desktop, or to a player (mpv, ffplay…) or a terminal image viewer (chafa, timg…) when there is not, and says what to install when nothing fits. Under tmux the program gets a window of its own and the browser stays up beside it; without tmux the browser hands the terminal over, the way vim's :sh does, and starts again with every pane where it was and the open document re-read. Modelled on moshcode's /shell and /new. The bytes outrank the name for `x`: code.ts is TypeScript, not an MPEG transport stream, and driving the built binary in tmux is where ffplay was handed a source file. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhtFxxWvkm4izFq8Y1RQBo
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.
What
eopens the file under the cursor in the system editor;xopens it with whatever the system opens it with. Both work from the panes and from the viewer, and both sit in the footer and the help.$VISUAL, then$EDITOR, then the first of vim, nvim, nano, vi on PATH. A remote file is edited on the server overssh -t(port, key and jump host carried over) with the editor the server has, so nothing is downloaded or uploaded back.code.tsis never sent to a player.:shdoes, and comes back with every pane where it was and the open document re-read. Modelled on moshcode's/shelland/new.Tests
18 new tests: the editor chain, local and remote edit commands (quoting included), media routing by desktop and by installed program, the text-over-name rule, the tmux and hand-off paths through a fake launcher, coming back from a hand-off, and the footer caps. 687 tests pass repo-wide; typecheck is clean. The built binary was driven both inside a private tmux server (a
code.tswindow opened with vim in it) and outside tmux (vim took the terminal,:qbrought the browser back).🤖 Generated with Claude Code
https://claude.ai/code/session_01AhtFxxWvkm4izFq8Y1RQBo