Skip to content
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 Bobcat to the list of terminal emulators with image preview support #2204

Closed
wants to merge 5 commits into from

Conversation

ismail-yilmaz
Copy link

@ismail-yilmaz ismail-yilmaz commented Jan 14, 2025

Bobcat -a cross-platform vt- can also run yazi with image previews just fine. It supports both iterm2 & sixel protocols with yazi out-of-the-box.

@sxyazi
Copy link
Owner

sxyazi commented Jan 15, 2025

Thanks for the PR, Bobcat looks amazing, nice work!

Does Bobcat have any environment variables (like TERM, TERM_PROGRAM), or CSI > q that can uniquely identify the terminal type for more precise matching? If so, could you add it to:

let vars = [
("KITTY_WINDOW_ID", B::Kitty),
("KONSOLE_VERSION", B::Konsole),
("ITERM_SESSION_ID", B::Iterm2),
("WEZTERM_EXECUTABLE", B::WezTerm),
("GHOSTTY_RESOURCES_DIR", B::Ghostty),
("WT_Session", B::Microsoft),
("ALACRITTY_WINDOW_ID", B::Alacritty),
("VSCODE_INJECTION", B::VSCode),
("TABBY_CONFIG_DIRECTORY", B::Tabby),

match program.as_str() {
"iTerm.app" => return Some(B::Iterm2),
"WezTerm" => return Some(B::WezTerm),
"ghostty" => return Some(B::Ghostty),
"rio" => return Some(B::Rio),
"BlackBox" => return Some(B::BlackBox),
"vscode" => return Some(B::VSCode),
"Tabby" => return Some(B::Tabby),
"Hyper" => return Some(B::Hyper),
"mintty" => return Some(B::Mintty),
"Apple_Terminal" => return Some(B::Apple),
_ => warn!("[Adapter] Unknown TERM_PROGRAM: {program}"),

match term.as_str() {
"xterm-kitty" => return Some(B::Kitty),
"foot" => return Some(B::Foot),
"foot-extra" => return Some(B::Foot),
"xterm-ghostty" => return Some(B::Ghostty),
"rio" => return Some(B::Rio),
"alacritty" => return Some(B::Alacritty),
"rxvt-unicode-256color" => return Some(B::Urxvt),
_ => warn!("[Adapter] Unknown TERM: {term}"),

And for CSI > q:

let names = [
("kitty", Self::Kitty),
("Konsole", Self::Konsole),
("iTerm2", Self::Iterm2),
("WezTerm", Self::WezTerm),
("foot", Self::Foot),
("ghostty", Self::Ghostty),
];

@sxyazi sxyazi force-pushed the main branch 2 times, most recently from 6c32e4c to 6a5fa71 Compare January 15, 2025 05:35
Bobcat is added to the list of recognized terminal emulators. It uses the extended device attributes report  command (`CSI q <`) to report its id.
@ismail-yilmaz
Copy link
Author

@sxyazi

Hi,

Thank you for your prompt reply and this great tool.

I have updated the brands list to include Bobcat. It uses extended device attributes report to reveal its id. Should be fine now, however in case anything else is missing, please let me know, I'll adjust the files asap.

@sxyazi
Copy link
Owner

sxyazi commented Jan 15, 2025

I noticed that your commit message mentions CSI q <, which is a sequence not supported by Yazi.

Did you mean CSI > q instead?

@ismail-yilmaz
Copy link
Author

I noticed that your commit message mentions CSI q <, which is a sequence not supported by Yazi.

Did you mean CSI > q instead?

Ah, yes, a typo. :)

@sxyazi
Copy link
Owner

sxyazi commented Jan 15, 2025

Gotcha. Could you rebase the PR?

@sxyazi sxyazi force-pushed the main branch 11 times, most recently from 4c5698d to 5058cf2 Compare January 19, 2025 14:54
@sxyazi
Copy link
Owner

sxyazi commented Jan 24, 2025

I'm going to close this because it still needs some work and hasn't seen any activity recently. @ismail-yilmaz thanks for the effort!

@sxyazi sxyazi closed this Jan 24, 2025
@ismail-yilmaz
Copy link
Author

I'm going to close this because it still needs some work and hasn't seen any activity recently. @ismail-yilmaz thanks for the effort!

Hi,

I apologize for the inconvenience. I've been dealing with some health issues, which caused the delay. If it is OK with you, I will make a new and proper pull request tomorrow.

@sxyazi
Copy link
Owner

sxyazi commented Jan 26, 2025

No worries - sure, go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants