Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d3380c668a |
@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [0.10.0] - 2026-03-05
|
||||
|
||||
### Added
|
||||
- fzf preview panel: hovering over a project shows its `README.md` in the right 40% of the screen
|
||||
- Uses `glow` for rendered markdown when available, falls back to `cat`
|
||||
- `CLICOLOR_FORCE=1` ensures glow outputs full ANSI colors even in fzf's non-TTY preview pipe
|
||||
- Preview command runs via `sh -c '...' -- {}` for compatibility with fish, zsh, and bash
|
||||
|
||||
## [0.9.2] - 2026-03-04
|
||||
|
||||
### Changed
|
||||
|
||||
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -293,9 +293,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.4.1"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec"
|
||||
checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
@ -570,18 +570,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.44"
|
||||
version = "1.0.45"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
|
||||
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "r-efi"
|
||||
version = "5.3.0"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
|
||||
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
@ -809,7 +809,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom 0.4.1",
|
||||
"getrandom 0.4.2",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.61.2",
|
||||
@ -857,7 +857,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tmuxido"
|
||||
version = "0.9.2"
|
||||
version = "0.10.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1133,9 +1133,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.7.14"
|
||||
version = "0.7.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
|
||||
checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tmuxido"
|
||||
version = "0.9.2"
|
||||
version = "0.10.0"
|
||||
edition = "2024"
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@ -17,7 +17,7 @@ A Rust-based tool to quickly find and open projects in tmux using fzf. No extern
|
||||
## Features
|
||||
|
||||
- Search for git repositories in configurable paths
|
||||
- Interactive selection using fzf
|
||||
- Interactive selection using fzf with live `README.md` preview (rendered via `glow` when available)
|
||||
- Native tmux session creation (no tmuxinator required!)
|
||||
- Support for project-specific `.tmuxido.toml` configs
|
||||
- Smart session switching (reuses existing sessions)
|
||||
|
||||
26
src/main.rs
26
src/main.rs
@ -116,8 +116,34 @@ fn main() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn readme_preview_command() -> String {
|
||||
let glow_available = Command::new("sh")
|
||||
.args(["-c", "command -v glow"])
|
||||
.output()
|
||||
.map(|o| o.status.success())
|
||||
.unwrap_or(false);
|
||||
// CLICOLOR_FORCE=1 tells termenv (used by glow/glamour) to enable ANSI
|
||||
// colors even when stdout is not a TTY (fzf preview runs in a pipe).
|
||||
// Without it, glow falls back to bold-only "notty" style with no colors.
|
||||
// Use `sh -c '...' -- {}` so the command runs in POSIX sh regardless of
|
||||
// the user's $SHELL (fish, zsh, bash, etc.).
|
||||
let viewer_cmd = if glow_available {
|
||||
"CLICOLOR_FORCE=1 glow -s dark"
|
||||
} else {
|
||||
"cat"
|
||||
};
|
||||
format!(
|
||||
r#"sh -c 'readme="$1/README.md"; [ -f "$readme" ] && {viewer_cmd} "$readme" || echo "No README.md"' -- {{}}"#
|
||||
)
|
||||
}
|
||||
|
||||
fn select_project_with_fzf(projects: &[PathBuf]) -> Result<PathBuf> {
|
||||
let preview_cmd = readme_preview_command();
|
||||
let mut child = Command::new("fzf")
|
||||
.arg("--preview")
|
||||
.arg(&preview_cmd)
|
||||
.arg("--preview-window")
|
||||
.arg("right:40%")
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.spawn()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user