mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
cf254f22a3
commit
0d5a5d1212
3 changed files with 15 additions and 14 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
use core::{emit, files::FilesOp, input::InputMode, Event};
|
use core::{emit, files::FilesOp, input::InputMode, Event};
|
||||||
|
use std::ffi::OsString;
|
||||||
|
|
||||||
use anyhow::{Ok, Result};
|
use anyhow::{Ok, Result};
|
||||||
use config::{keymap::{Control, Key, KeymapLayer}, BOOT};
|
use config::{keymap::{Control, Key, KeymapLayer}, BOOT};
|
||||||
|
|
@ -182,7 +183,15 @@ impl App {
|
||||||
s
|
s
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
{
|
||||||
|
std::fs::write(p, paths.to_string_lossy().as_bytes()).ok();
|
||||||
|
}
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
{
|
||||||
|
use std::os::unix::ffi::OsStrExt;
|
||||||
std::fs::write(p, paths.as_bytes()).ok();
|
std::fs::write(p, paths.as_bytes()).ok();
|
||||||
|
}
|
||||||
return emit!(Quit);
|
return emit!(Quit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ impl Default for Boot {
|
||||||
let boot = Self {
|
let boot = Self {
|
||||||
cwd: cwd.unwrap_or("/".into()),
|
cwd: cwd.unwrap_or("/".into()),
|
||||||
cache_dir: env::temp_dir().join("yazi"),
|
cache_dir: env::temp_dir().join("yazi"),
|
||||||
state_dir: xdg::BaseDirectories::with_prefix("yazi").unwrap().get_state_home(),
|
state_dir: Xdg::state_dir().unwrap(),
|
||||||
|
|
||||||
cwd_file: args.cwd_file,
|
cwd_file: args.cwd_file,
|
||||||
chooser_file: args.chooser_file,
|
chooser_file: args.chooser_file,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
use anyhow::Result;
|
|
||||||
use std::io::{stdout, Write};
|
use std::io::{stdout, Write};
|
||||||
|
|
||||||
use crossterm::{
|
use anyhow::Result;
|
||||||
cursor::{self, MoveTo, RestorePosition, SavePosition, SetCursorStyle},
|
use crossterm::{cursor::{MoveTo, RestorePosition, SavePosition, SetCursorStyle}, execute, queue, terminal::{Clear, ClearType}};
|
||||||
execute, queue,
|
|
||||||
terminal::{Clear, ClearType},
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::Term;
|
use crate::Term;
|
||||||
|
|
||||||
|
|
@ -45,12 +41,8 @@ impl Term {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_cursor_block() -> Result<()> {
|
pub fn set_cursor_block() -> Result<()> { Ok(execute!(stdout(), SetCursorStyle::BlinkingBlock)?) }
|
||||||
Ok(execute!(stdout(), SetCursorStyle::BlinkingBlock)?)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_cursor_bar() -> Result<()> {
|
pub fn set_cursor_bar() -> Result<()> { Ok(execute!(stdout(), SetCursorStyle::BlinkingBar)?) }
|
||||||
Ok(execute!(stdout(), SetCursorStyle::BlinkingBar)?)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue