More Windows-specific fixes.
This commit is contained in:
parent
f11950b0de
commit
5f329ccab4
2 changed files with 4 additions and 0 deletions
|
@ -139,6 +139,7 @@ fn get_radkfile_path() -> Option<PathBuf> {
|
|||
use std::os::windows::ffi::OsStringExt;
|
||||
use windows_sys::Win32::Foundation::{MAX_PATH, S_OK};
|
||||
use windows_sys::Win32::UI::Shell::{SHGetFolderPathW, CSIDL_PROFILE};
|
||||
use std::env;
|
||||
|
||||
match env::var_os("USERPROFILE").filter(|s| !s.is_empty()).map(PathBuf::from) {
|
||||
Some(path) => {
|
||||
|
|
|
@ -12,6 +12,7 @@ use word_search::word_search;
|
|||
use kanji_search::search_by_radical;
|
||||
use sentence_search::sentence_search;
|
||||
|
||||
|
||||
use argparse::{ArgumentParser, List, Print, Store, StoreTrue};
|
||||
use serde_json::Value;
|
||||
use atty::Stream;
|
||||
|
@ -202,6 +203,8 @@ fn terminal_size() -> Result<usize, i16> {
|
|||
#[cfg(windows)]
|
||||
fn terminal_size() -> Result<usize, i16> {
|
||||
use windows_sys::Win32::System::Console::*;
|
||||
use colored::control;
|
||||
|
||||
if let Err(e) = control::set_virtual_terminal(true) {
|
||||
panic!("Could not set terminal as virtual: {:?}", e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue