fixed unix code
This commit is contained in:
parent
b884891970
commit
a6149f75f3
15
crossterm.iml
Normal file
15
crossterm.iml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="RUST_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/examples" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/benches" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -27,7 +27,7 @@ impl RawScreen {
|
||||
pub fn into_raw_mode() -> io::Result<()>
|
||||
{
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
let mut command = unix_command::RawModeCommand::new();
|
||||
let mut command = unix_command::NoncanonicalModeCommand::new();
|
||||
#[cfg(target_os = "windows")]
|
||||
let mut command = win_commands::RawModeCommand::new();
|
||||
|
||||
@ -39,7 +39,7 @@ impl RawScreen {
|
||||
pub fn disable_raw_modes() -> io::Result<()>
|
||||
{
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
let mut command = unix_command::RawModeCommand::new();
|
||||
let mut command = unix_command::NoncanonicalModeCommand::new();
|
||||
#[cfg(target_os = "windows")]
|
||||
let mut command = win_commands::RawModeCommand::new();
|
||||
|
||||
|
@ -46,8 +46,8 @@ pub fn terminal_size() -> (u16, u16) {
|
||||
|
||||
/// Get the current cursor position.
|
||||
pub fn pos(stdout: &Arc<Stdout>) -> (u16, u16) {
|
||||
let mut crossterm = Crossterm::new();
|
||||
let input = crossterm.input(&Screen::default());
|
||||
let mut crossterm = Crossterm::new(&Screen::default());
|
||||
let input = crossterm.input();
|
||||
|
||||
let delimiter = b'R';
|
||||
let mut stdin = input.read_until_async(delimiter);
|
||||
|
Loading…
Reference in New Issue
Block a user