Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
termion
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
61
Issues
61
List
Boards
Labels
Service Desk
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
termion
Commits
18922255
Commit
18922255
authored
Jun 26, 2020
by
Jeremy Soller
1
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'master'
Added AsRawFd impl for RawTerminal See merge request
!170
parents
a448f510
c471ab68
Pipeline
#7834
failed with stages
in 2 minutes and 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
src/raw.rs
src/raw.rs
+14
-2
No files found.
src/raw.rs
View file @
18922255
...
...
@@ -25,8 +25,8 @@
use
std
::
io
::{
self
,
Write
};
use
std
::
ops
;
use
sys
::
Termios
;
use
sys
::
attr
::{
get_terminal_attr
,
raw_terminal_attr
,
set_terminal_attr
};
use
sys
::
Termios
;
/// The timeout of an escape code control sequence, in milliseconds.
pub
const
CONTROL_SEQUENCE_TIMEOUT
:
u64
=
100
;
...
...
@@ -70,6 +70,18 @@ impl<W: Write> Write for RawTerminal<W> {
}
}
#[cfg(unix)]
mod
unix_impl
{
use
super
::
*
;
use
std
::
os
::
unix
::
io
::{
AsRawFd
,
RawFd
};
impl
<
W
:
Write
+
AsRawFd
>
AsRawFd
for
RawTerminal
<
W
>
{
fn
as_raw_fd
(
&
self
)
->
RawFd
{
self
.output
.as_raw_fd
()
}
}
}
/// Types which can be converted into "raw mode".
///
/// # Why is this type defined on writers and not readers?
...
...
@@ -120,7 +132,7 @@ impl<W: Write> RawTerminal<W> {
#[cfg(test)]
mod
test
{
use
super
::
*
;
use
std
::
io
::{
Write
,
stdout
};
use
std
::
io
::{
stdout
,
Write
};
#[test]
fn
test_into_raw_mode
()
{
...
...
matu3ba
@matu3ba
mentioned in issue
#188
·
Dec 15, 2020
mentioned in issue
#188
mentioned in issue #188
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment