mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: delegate the SIGINT signal of processes with orphan=true to their parent (#290)
This commit is contained in:
parent
bed8172347
commit
51ab86b1b8
2 changed files with 10 additions and 4 deletions
12
core/src/external/shell.rs
vendored
12
core/src/external/shell.rs
vendored
|
|
@ -30,7 +30,7 @@ impl ShellOpt {
|
|||
|
||||
pub fn shell(opt: ShellOpt) -> Result<Child> {
|
||||
#[cfg(unix)]
|
||||
return Ok(
|
||||
return Ok(unsafe {
|
||||
Command::new("sh")
|
||||
.arg("-c")
|
||||
.stdin(opt.stdio())
|
||||
|
|
@ -40,8 +40,14 @@ pub fn shell(opt: ShellOpt) -> Result<Child> {
|
|||
.arg("") // $0 is the command name
|
||||
.args(opt.args)
|
||||
.kill_on_drop(!opt.orphan)
|
||||
.spawn()?,
|
||||
);
|
||||
.pre_exec(move || {
|
||||
if opt.orphan && libc::setpgid(0i32, 0i32) < 0 {
|
||||
libc::perror(std::ptr::null());
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
.spawn()?
|
||||
});
|
||||
|
||||
#[cfg(windows)]
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"language":"en","flagWords":[],"version":"0.2","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","linemode"]}
|
||||
{"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","linemode","setpgid","perror"],"version":"0.2","flagWords":[],"language":"en"}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue