diff --git a/README.md b/README.md index 0d1adc40..3c776589 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ https://github.com/sxyazi/yazi/assets/17523360/92ff23fa-0cd5-4f04-b387-894c12265 | WezTerm | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in | | Mintty (Git Bash) | [Inline images protocol](https://iterm2.com/documentation-images.html) | ✅ Built-in | | foot | [Sixel graphics format](https://www.vt100.net/docs/vt3xx-gp/chapter14.html) | ✅ Built-in | +| Ghostty | [Kitty old protocol](https://github.com/sxyazi/yazi/blob/main/yazi-adaptor/src/kitty_old.rs) | ✅ Built-in | | Black Box | [Sixel graphics format](https://www.vt100.net/docs/vt3xx-gp/chapter14.html) | ✅ Built-in | | Hyper | [Sixel graphics format](https://www.vt100.net/docs/vt3xx-gp/chapter14.html) | ✅ Built-in | | X11 / Wayland | Window system protocol | ☑️ Überzug++ required | diff --git a/cspell.json b/cspell.json index 933340ab..4ac57c87 100644 --- a/cspell.json +++ b/cspell.json @@ -1 +1 @@ -{"language":"en","words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","ffmpegthumbnailer","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","️ Überzug","️ Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode","sxyazi","rsplit","ZELLIJ","bitflags","bitflags","USERPROFILE","Neovim","vergen","gitcl","Renderable","preloaders","prec","imagesize","Upserting","prio"],"version":"0.2","flagWords":[]} +{"flagWords":[],"version":"0.2","language":"en","words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","ffmpegthumbnailer","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","️ Überzug","️ Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode","sxyazi","rsplit","ZELLIJ","bitflags","bitflags","USERPROFILE","Neovim","vergen","gitcl","Renderable","preloaders","prec","imagesize","Upserting","prio","Ghostty"]} \ No newline at end of file diff --git a/yazi-adaptor/src/adaptor.rs b/yazi-adaptor/src/adaptor.rs index ee84acf0..a4668ddf 100644 --- a/yazi-adaptor/src/adaptor.rs +++ b/yazi-adaptor/src/adaptor.rs @@ -29,6 +29,7 @@ enum Emulator { Iterm2, WezTerm, Foot, + Ghostty, BlackBox, VSCode, Hyper, @@ -47,6 +48,7 @@ impl Adaptor { ("KONSOLE_VERSION", Emulator::Konsole), ("ITERM_SESSION_ID", Emulator::Iterm2), ("WEZTERM_EXECUTABLE", Emulator::WezTerm), + ("GHOSTTY_RESOURCES_DIR", Emulator::Ghostty), ("VSCODE_INJECTION", Emulator::VSCode), ]; match vars.into_iter().find(|v| env_exists(v.0)) { @@ -58,6 +60,7 @@ impl Adaptor { match program.as_str() { "iTerm.app" => return Emulator::Iterm2, "WezTerm" => return Emulator::WezTerm, + "ghostty" => return Emulator::Ghostty, "BlackBox" => return Emulator::BlackBox, "vscode" => return Emulator::VSCode, "Hyper" => return Emulator::Hyper, @@ -68,6 +71,7 @@ impl Adaptor { "xterm-kitty" => return Emulator::Kitty, "foot" => return Emulator::Foot, "foot-extra" => return Emulator::Foot, + "xterm-ghostty" => return Emulator::Ghostty, _ => warn!("[Adaptor] Unknown TERM: {term}"), } Emulator::Unknown @@ -81,6 +85,7 @@ impl Adaptor { Emulator::Iterm2 => vec![Self::Iterm2, Self::Sixel], Emulator::WezTerm => vec![Self::Iterm2, Self::Sixel], Emulator::Foot => vec![Self::Sixel], + Emulator::Ghostty => vec![Self::KittyOld], Emulator::BlackBox => vec![Self::Sixel], Emulator::VSCode => vec![Self::Sixel], Emulator::Hyper => vec![Self::Sixel],