mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: disable passthrough when the user launches Yazi in Neovim inside tmux
This commit is contained in:
parent
b8b3ab9be3
commit
17226f8044
6 changed files with 21 additions and 7 deletions
|
|
@ -1,11 +1,15 @@
|
||||||
|
cargo publish -p yazi-macro
|
||||||
|
sleep 30
|
||||||
|
cargo publish -p yazi-codegen
|
||||||
|
sleep 30
|
||||||
cargo publish -p yazi-shared
|
cargo publish -p yazi-shared
|
||||||
sleep 30
|
sleep 30
|
||||||
|
cargo publish -p yazi-fs
|
||||||
|
sleep 30
|
||||||
cargo publish -p yazi-config
|
cargo publish -p yazi-config
|
||||||
sleep 30
|
sleep 30
|
||||||
cargo publish -p yazi-proxy
|
cargo publish -p yazi-proxy
|
||||||
sleep 30
|
sleep 30
|
||||||
cargo publish -p yazi-fs
|
|
||||||
sleep 30
|
|
||||||
cargo publish -p yazi-adapter
|
cargo publish -p yazi-adapter
|
||||||
sleep 30
|
sleep 30
|
||||||
cargo publish -p yazi-boot
|
cargo publish -p yazi-boot
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use tracing::warn;
|
use tracing::warn;
|
||||||
use yazi_shared::env_exists;
|
use yazi_shared::env_exists;
|
||||||
|
|
||||||
use crate::Mux;
|
use crate::{Mux, NVIM};
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub enum Brand {
|
pub enum Brand {
|
||||||
|
|
@ -27,7 +27,7 @@ impl Brand {
|
||||||
pub fn from_env() -> Option<Self> {
|
pub fn from_env() -> Option<Self> {
|
||||||
use Brand as B;
|
use Brand as B;
|
||||||
|
|
||||||
if env_exists("NVIM_LOG_FILE") && env_exists("NVIM") {
|
if *NVIM {
|
||||||
return Some(Self::Neovim);
|
return Some(Self::Neovim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@ static CLOSE: RoCell<&'static str> = RoCell::new();
|
||||||
// WSL support
|
// WSL support
|
||||||
pub static WSL: RoCell<bool> = RoCell::new();
|
pub static WSL: RoCell<bool> = RoCell::new();
|
||||||
|
|
||||||
|
// Neovim support
|
||||||
|
pub static NVIM: RoCell<bool> = RoCell::new();
|
||||||
|
|
||||||
pub fn init() -> anyhow::Result<()> {
|
pub fn init() -> anyhow::Result<()> {
|
||||||
// Tmux support
|
// Tmux support
|
||||||
TMUX.init(env_exists("TMUX_PANE") && env_exists("TMUX"));
|
TMUX.init(env_exists("TMUX_PANE") && env_exists("TMUX"));
|
||||||
|
|
@ -40,6 +43,9 @@ pub fn init() -> anyhow::Result<()> {
|
||||||
// WSL support
|
// WSL support
|
||||||
WSL.init(in_wsl());
|
WSL.init(in_wsl());
|
||||||
|
|
||||||
|
// Neovim support
|
||||||
|
NVIM.init(env_exists("NVIM_LOG_FILE") && env_exists("NVIM"));
|
||||||
|
|
||||||
EMULATOR.init(Emulator::detect());
|
EMULATOR.init(Emulator::detect());
|
||||||
yazi_config::init_flavor(EMULATOR.light)?;
|
yazi_config::init_flavor(EMULATOR.light)?;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
use crate::{CLOSE, ESCAPE, START, TMUX};
|
use crate::{CLOSE, ESCAPE, NVIM, START, TMUX};
|
||||||
|
|
||||||
pub struct Mux;
|
pub struct Mux;
|
||||||
|
|
||||||
impl Mux {
|
impl Mux {
|
||||||
pub fn csi(s: &str) -> std::borrow::Cow<str> {
|
pub fn csi(s: &str) -> std::borrow::Cow<str> {
|
||||||
if *TMUX {
|
if *TMUX && !*NVIM {
|
||||||
std::borrow::Cow::Owned(format!(
|
std::borrow::Cow::Owned(format!(
|
||||||
"{}{}{}",
|
"{}{}{}",
|
||||||
*START,
|
*START,
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,10 @@ impl Actions {
|
||||||
writeln!(s, "\nWSL")?;
|
writeln!(s, "\nWSL")?;
|
||||||
writeln!(s, " WSL: {:?}", *yazi_adapter::WSL)?;
|
writeln!(s, " WSL: {:?}", *yazi_adapter::WSL)?;
|
||||||
|
|
||||||
|
writeln!(s, "\nNVIM")?;
|
||||||
|
writeln!(s, " NVIM : {:?}", *yazi_adapter::NVIM)?;
|
||||||
|
writeln!(s, " Neovim version: {:?}", Self::process_output("nvim", "--version"))?;
|
||||||
|
|
||||||
writeln!(s, "\nVariables")?;
|
writeln!(s, "\nVariables")?;
|
||||||
writeln!(s, " SHELL : {:?}", env::var_os("SHELL"))?;
|
writeln!(s, " SHELL : {:?}", env::var_os("SHELL"))?;
|
||||||
writeln!(s, " EDITOR : {:?}", env::var_os("EDITOR"))?;
|
writeln!(s, " EDITOR : {:?}", env::var_os("EDITOR"))?;
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,5 @@ proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# External dependencies
|
# External dependencies
|
||||||
syn = "2.0.90"
|
syn = { version = "2.0.90", features = [ "full" ] }
|
||||||
quote = "1.0.37"
|
quote = "1.0.37"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue