-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add preview support (#16) #203
Conversation
02209a2
to
22d09b9
Compare
fix: typo (joshmedeski#16) fix: restore glyphs in previewer tests (joshmedeski#16)
22d09b9
to
4b57b32
Compare
Dude, this is awesome, nice work! Here is some feedback:
Overall, this is great work, I don't see anything glaringly wrong with the code itself, just some clarification on the configuration, thanks again. |
Thanks, my man @joshmedeski! I love using Sesh and wanted to contribute to give back. Thank you for creating it and for all your hard work.
Ah, I knew I was forgetting something—I didn’t document it, sorry about that! I’ll add documentation once we clarify its purpose and figure out how it should be configured. In essence, $ eza --all --git --icons --color=always {path_to_directory} This gives a nice
I see how this might be confusing. Placing it in the In reality, it’s a directory previewer configuration. Perhaps we should create a dedicated TOML table for previewer-specific settings? Alternatively, we could move it to the root of the config for clarity. Let me know what you think!
Thank you so much! This is actually my first contribution in Golang, so I’m thrilled it meets acceptable quality standards. I’m usually a TypeScript dev, so this was a fun learning experience. |
This is how I see the preview_command working: [default_session]
startup_command = "nvim +GoToFile"
preview_command = "lsd --group-dirs first -A {path_to_directory}"
[[session]]
name = "tmux config"
path = "~/c/dotfiles/.config/tmux"
startup_command = "nvim tmux.conf"
preview_command = "bat ~/c/dotfiles/.config/tmux/tmux.conf" It's a preview for the session, so semantically I think it's clear for both default or custom sessions. The only piece that isn't intuitive is the Similar to the startup strategies, I recommend creating a default config strategy before the directory NewTmuxStrategy(lister, tmux),
NewConfigStrategy(lister, ls),
NewDefaultConfigStrategy(config, lister, ls), // config should be passed as a dependency to get the default value
NewDirectoryStrategy(home, dir, ls), |
Oh, that makes sense! That's awesome, I'll work on it. Maybe we can borrow the syntax from |
Replace hardcoded ls command with configurable preview command that supports path placeholder. This allows users to customize how sessions are previewed with their preferred commands. The preview command can be set per-session or globally in config, with fallback to default ls behavior. Commands support {} placeholder which gets replaced with the session path.
Add documentation and examples for the new preview command feature in both default and per-session configurations. Include examples using bat and eza tools for file and directory previews.
Hey @joshmedeski, I've added a custom Thank you! |
Hi @joshmedeski have you had a chance to look at this yet? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, nice work!
@joshmedeski thank you so much for merging it. Happy new year! |
Description
Adds preview functionality to sesh for displaying session/directory contents in fzf preview window, this should close #16 .
Features
The preview shows:
Screenshots
Tmux Session
Config Directory
Tmuxinator
Zoxide
fd
custom preview_command with bat