Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ef5af87f
Commit
ef5af87f
authored
Sep 21, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conhost: Introduce Unix mode.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c6909e52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
conhost.c
programs/conhost/conhost.c
+21
-7
No files found.
programs/conhost/conhost.c
View file @
ef5af87f
...
...
@@ -79,6 +79,7 @@ struct console
HANDLE
server
;
/* console server handle */
unsigned
int
mode
;
/* input mode */
struct
screen_buffer
*
active
;
/* active screen buffer */
int
is_unix
;
/* UNIX terminal mode */
INPUT_RECORD
*
records
;
/* input records */
unsigned
int
record_count
;
/* number of input records */
unsigned
int
record_size
;
/* size of input records buffer */
...
...
@@ -356,10 +357,14 @@ static void tty_sync( struct console *console )
static
void
init_tty_output
(
struct
console
*
console
)
{
/* initialize tty output, but don't flush */
tty_write
(
console
,
"
\x1b
[2J"
,
4
);
/* clear screen */
set_tty_attr
(
console
,
console
->
active
->
attr
);
tty_write
(
console
,
"
\x1b
[H"
,
3
);
/* move cursor to (0,0) */
if
(
!
console
->
is_unix
)
{
/* initialize tty output, but don't flush */
tty_write
(
console
,
"
\x1b
[2J"
,
4
);
/* clear screen */
set_tty_attr
(
console
,
console
->
active
->
attr
);
tty_write
(
console
,
"
\x1b
[H"
,
3
);
/* move cursor to (0,0) */
}
else
console
->
tty_attr
=
empty_char_info
.
attr
;
console
->
tty_cursor_visible
=
TRUE
;
}
...
...
@@ -2641,7 +2646,7 @@ static int main_loop( struct console *console, HANDLE signal )
int
__cdecl
wmain
(
int
argc
,
WCHAR
*
argv
[])
{
int
headless
=
0
,
i
,
width
=
80
,
height
=
15
0
;
int
headless
=
0
,
i
,
width
=
0
,
height
=
0
;
HANDLE
signal
=
NULL
,
input_thread
;
WCHAR
*
end
;
...
...
@@ -2664,18 +2669,24 @@ int __cdecl wmain(int argc, WCHAR *argv[])
headless
=
1
;
continue
;
}
if
(
!
wcscmp
(
argv
[
i
],
L"--unix"
))
{
console
.
is_unix
=
1
;
headless
=
1
;
continue
;
}
if
(
!
wcscmp
(
argv
[
i
],
L"--width"
))
{
if
(
++
i
==
argc
)
return
1
;
width
=
wcstol
(
argv
[
i
],
&
end
,
0
);
if
(
!
width
||
width
>
0xffff
||
*
end
)
return
1
;
if
(
(
!
width
&&
!
console
.
is_unix
)
||
width
>
0xffff
||
*
end
)
return
1
;
continue
;
}
if
(
!
wcscmp
(
argv
[
i
],
L"--height"
))
{
if
(
++
i
==
argc
)
return
1
;
height
=
wcstol
(
argv
[
i
],
&
end
,
0
);
if
(
!
height
||
height
>
0xffff
||
*
end
)
return
1
;
if
(
(
!
height
&&
!
console
.
is_unix
)
||
height
>
0xffff
||
*
end
)
return
1
;
continue
;
}
if
(
!
wcscmp
(
argv
[
i
],
L"--signal"
))
...
...
@@ -2708,6 +2719,9 @@ int __cdecl wmain(int argc, WCHAR *argv[])
return
1
;
}
if
(
!
width
)
width
=
80
;
if
(
!
height
)
height
=
150
;
if
(
!
(
console
.
active
=
create_screen_buffer
(
&
console
,
1
,
width
,
height
)))
return
1
;
if
(
headless
)
{
...
...
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