mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
a02086ab00
commit
313bee78b8
2 changed files with 15 additions and 17 deletions
|
|
@ -42,19 +42,17 @@ impl App {
|
|||
}
|
||||
|
||||
fn dispatch_quit(&mut self, no_cwd_file: bool) {
|
||||
if !no_cwd_file {
|
||||
if let Some(p) = &BOOT.cwd_file {
|
||||
let cwd = self.cx.manager.cwd().as_os_str();
|
||||
if let Some(p) = BOOT.cwd_file.as_ref().filter(|_| !no_cwd_file) {
|
||||
let cwd = self.cx.manager.cwd().as_os_str();
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
std::fs::write(p, cwd.to_string_lossy().as_bytes()).ok();
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
std::fs::write(p, cwd.as_bytes()).ok();
|
||||
}
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
std::fs::write(p, cwd.to_string_lossy().as_bytes()).ok();
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
std::fs::write(p, cwd.as_bytes()).ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
[manager]
|
||||
|
||||
keymap = [
|
||||
{ on = [ "<Esc>" ], exec = "escape", desc = "Exit visual mode, clear selected, or cancel search" },
|
||||
{ on = [ "q" ], exec = "quit", desc = "Exit the process" },
|
||||
{ on = [ "Q" ], exec = "quit --no-cwd-file", desc = "Exit the process without writing the current directory to cwd-file" },
|
||||
{ on = [ "<C-q>" ], exec = "close", desc = "Close the current tab, or quit if it is last tab" },
|
||||
{ on = [ "<C-z>" ], exec = "suspend", desc = "Suspend the process" },
|
||||
{ on = [ "<Esc>" ], exec = "escape", desc = "Exit visual mode, clear selected, or cancel search" },
|
||||
{ on = [ "q" ], exec = "quit", desc = "Exit the process" },
|
||||
{ on = [ "Q" ], exec = "quit --no-cwd-file", desc = "Exit the process without writing cwd-file" },
|
||||
{ on = [ "<C-q>" ], exec = "close", desc = "Close the current tab, or quit if it is last tab" },
|
||||
{ on = [ "<C-z>" ], exec = "suspend", desc = "Suspend the process" },
|
||||
|
||||
# Navigation
|
||||
{ on = [ "k" ], exec = "arrow -1", desc = "Move cursor up" },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue