mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 15:51:15 -03:00
Fix some import conventions
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
wchar::prelude::*,
|
||||
wutil::waccess,
|
||||
};
|
||||
use libc::STDIN_FILENO;
|
||||
#[cfg(feature = "embed-data")]
|
||||
use rust_embed::RustEmbed;
|
||||
use std::ffi::{CString, OsStr, OsString};
|
||||
@@ -371,7 +372,7 @@ fn fish_parse_opt(args: &mut [WString], opts: &mut FishCmdOpts) -> ControlFlow<i
|
||||
// We are an interactive session if we have not been given an explicit
|
||||
// command or file to execute and stdin is a tty. Note that the -i or
|
||||
// --interactive options also force interactive mode.
|
||||
if opts.batch_cmds.is_empty() && optind == args.len() && isatty(libc::STDIN_FILENO) {
|
||||
if opts.batch_cmds.is_empty() && optind == args.len() && isatty(STDIN_FILENO) {
|
||||
set_interactive_session(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -886,7 +886,7 @@ fn throwing_main() -> i32 {
|
||||
use crate::io::FdOutputStream;
|
||||
use crate::io::IoChain;
|
||||
use crate::io::OutputStream::Fd;
|
||||
use libc::{STDERR_FILENO, STDOUT_FILENO};
|
||||
use libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO};
|
||||
|
||||
topic_monitor_init();
|
||||
threads::init();
|
||||
@@ -895,7 +895,7 @@ fn throwing_main() -> i32 {
|
||||
let mut err = Fd(FdOutputStream::new(STDERR_FILENO));
|
||||
let io_chain = IoChain::new();
|
||||
let mut streams = IoStreams::new(&mut out, &mut err, &io_chain);
|
||||
streams.stdin_fd = libc::STDIN_FILENO;
|
||||
streams.stdin_fd = STDIN_FILENO;
|
||||
// Using the user's default locale could be a problem if it doesn't use UTF-8 encoding. That's
|
||||
// because the fish project assumes Unicode UTF-8 encoding in all of its scripts.
|
||||
//
|
||||
|
||||
@@ -298,7 +298,7 @@ fn throwing_main() -> i32 {
|
||||
return s.builtin_status_code();
|
||||
}
|
||||
|
||||
if !isatty(libc::STDIN_FILENO) {
|
||||
if !isatty(STDIN_FILENO) {
|
||||
streams
|
||||
.err
|
||||
.appendln(wgettext!("Stdin must be attached to a tty."));
|
||||
|
||||
Reference in New Issue
Block a user