Commit graph

188 commits

Author SHA1 Message Date
Eric Pouech b3fa23e88d conhost: Fix display of font preview in 64-bit mode.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-05-28 20:42:29 +02:00
Alexandre Julliard 83888e37df conhost: Fix a printf format warning. 2024-05-24 12:35:56 +02:00
Alexandre Julliard acad49573a makefiles: Always use the global SOURCES variable for .c files. 2023-11-01 22:44:03 +01:00
Alexandre Julliard 7ccb5df0fc makefiles: Always use the global SOURCES variable for .rc files. 2023-11-01 22:43:56 +01:00
Alex Henrie c46300ff28 conhost: Use the wcsdup function instead of reimplementing it. 2023-09-25 10:23:38 +02:00
Eric Pouech 10aaff9245 conhost: Fix ctrl-c handling.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55197
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-07-13 11:51:41 +02:00
Alex Henrie 2455229549 conhost: Use correct pointer type in edit_line_transpose_words (scan-build). 2023-06-19 17:42:16 +02:00
Alexandre Julliard 2e58c9e060 conhost: Use nameless union/structs. 2023-06-16 17:56:55 +02:00
Alex Henrie 8b54c2e35d conhost: Fix memory leak on error path in edit_line_move_to_history (scan-build). 2023-06-05 14:01:07 +02:00
Hugh McMaster 887aa70e08 kernelbase: Implement GetConsoleOriginalTitleW(). 2023-04-03 16:52:01 +02:00
Hugh McMaster 6891faf454 conhost: Save original console title on initialization. 2023-04-03 16:52:01 +02:00
Alexandre Julliard 9efe1a32a2 conhost: Use standard va_list instead of __ms_va_list. 2023-02-20 08:39:18 +01:00
Eric Pouech 7077c5bcab conhost: Only update font when running with a window.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54449
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-02-06 22:34:44 +01:00
Eric Pouech e8c7920919 conhost.exe: Handle ctrl-\ in Wine.
Let conhost handle ctrl-\ instead of Unix tty, and pretend it's a
ctrl-pause/break key stroke.  This allows CUI application in processed
input mode not to close upon ctrl-\.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54141
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-01-25 10:04:02 +01:00
Eric Pouech fda954dfd4 conhost.exe: Handle ctrl-pause/break key strokes.
Note: this patch should be extended by adding insertion
of the CTRL_BREAK_EVENT into processes' crtl handler
(as it's done for CTRL_C_EVENT).

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-01-25 10:04:00 +01:00
Eric Pouech ec05c03463 conhost: Initialize color_map when creating an alternate screen buffer.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54287
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-01-11 14:27:58 +01:00
Eric Pouech 8993f5720a conhost: Reset console attribute upon exit in unix mode.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-01-11 14:27:54 +01:00
Hugh McMaster 0e6b21ef1d conhost: Migrate from FontPitchFamily to FontFamily.
To ensure a seamless transition between value names, we try loading the
registry value from FontFamily first and FontPitchFamily second.

Any changes to the console font family are saved to the new value name.
2023-01-11 11:54:16 +01:00
Eric Pouech af215210f0 kernel32/tests: Skip some console tests on w1064v1909.
We get conhost.exe:tty failures on testbot:
- not for version prior to w1064v1909 (these tests require
  pseudo-consoles, which are not implemented in these Windows
  version).
- for w1064v1909
- not for W10 versions after w1064v1909.

So, we assume that pseudo-console support is immature in this
Windows version: skip all the remaining test at the first
discrepancy point.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53465
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-12-21 18:24:39 +01:00
Eric Pouech 0a7c04816f conhost: Don't print control characters for Unix tty.
They will be reinterpreted by Unix tty, leading to wrong display.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-12-20 22:37:02 +01:00
Eric Pouech 9317a331f1 conhost/tests: Fix some conditions on tty test termination.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-11-01 20:46:23 +01:00
Eric Pouech 5a8350120c conhost/tests: Fix some tests on input sequences.
Correctly handling keyboards (French, German...) which report right-alt
as ctrl+alt in VkKeyScan().

Splitting escape_test input tests into pure virtual keys on one hand,
and modified char key on the other.
Generating the virtual codes for the later instead of hardcoding the
results (bound to generic US keyboard).

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52980
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-10-24 18:50:36 +02:00
Eric Pouech bdad6f2c85 conhost/tests: Fix tests for some keyboard layouts.
Some keyboards (French, German and some others) report the right alt key
(which is some cases the right-shift one) as ctrl+alt.
Add proper handling for ctrl+alt return from VkKeyScan().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52980
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-10-24 18:50:29 +02:00
Eric Pouech c19f3b620a conhost: Fix tests on ReadConsole with CONSOLE_READCONSOLE_CONTROL.
It should fix the errors around line 1370 in conhost/tests/tty.c, but
it doesn't fix other errors around line 1530 and 1550 which are
completly unrelated to this change.  So failures to be expected on the
latter.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52648
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-10-10 11:22:23 +02:00
Hugh McMaster 627f2b3557 kernelbase: Return full title length from GetConsoleTitle(). 2022-10-10 11:19:44 +02:00
Hugh McMaster 577258a981 conhost: Update debug output and comments when loading/saving settings.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-09 20:55:20 +02:00
Hugh McMaster 1c9c1ebc80 conhost: Show caret immediately after reshaping.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-09 20:55:20 +02:00
Hugh McMaster 25f012edcb conhost: Don't prompt the user to save their app-specific settings.
On Windows, app-specific console settings are always saved to the
registry unless the user cancels the console properties dialog.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 22:07:42 +02:00
Hugh McMaster bb2b1d0ed1 conhost: Only save app-specific settings that differ from the defaults.
On Windows, app-specific subkeys of HKCU\Console only hold console
settings that differ from the global defaults.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 22:07:42 +02:00
Hugh McMaster 37bcbe6bca conhost: Save console settings as global defaults on first run.
On Windows, HKCU\Console holds global default settings, while subkeys
hold any app-specific settings that differ from the defaults.

Wine's conhost.exe implementation currently saves all console settings
to an app-specific subkey on the first run, while global defaults are
only saved to HKCU\Console if the user selects 'Set Defaults' from the
pop-up menu and saves new settings. This is the opposite of console
behaviour on Windows.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 22:07:42 +02:00
Hugh McMaster 303f8042f9 conhost: Set correct face name when the specified font is not available.
conhost.exe currently copies the user-specified face name from the
LOGFONT structure. This results in an invalid face name when the
specified font is not available.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-24 21:25:02 +02:00
Hugh McMaster 7a32bc9e32 conhost: Split first font code path from font update code path.
This change prevents calls to update_console_font() setting any defaults.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-23 20:50:21 +02:00
Hugh McMaster a2bb60e62c conhost: Save default font's pitch and family on first run.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-22 13:09:51 +02:00
Francois Gouget 7b63a5f446 conhost: Fix the spelling of a couple of comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-18 12:36:24 +02:00
Jacek Caban b4d91adb16 kernelbase: Add support for CREATE_NO_WINDOW flag in CreateProcess.
Based on patches by Eric Pouech and Torge Matthies.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 21:39:42 +02:00
Eric Pouech bb05f13fd8 conhost: Support relative cursor positioning.
Also add fallback method when legacy console APIs where used.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 21:24:59 +01:00
Eric Pouech 9198ca27d0 conhost: Correctly recompute start of edit line on ReadConsole.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 19:11:06 +01:00
Hugh McMaster da854c537d conhost: Reimplement font dialog handling.
Much of the existing font dialog code is overly complicated and difficult
to follow. There are also bugs in the code, which cannot be fixed with
minimal changes due to the complexity of the existing source. For example,
changing the font face via the listbox unexpectedly changes the font size.
It is also unnecessary to recreate the list of available font sizes
each font face selection if the font type remains unchanged.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 21:42:43 +01:00
Hugh McMaster dfb7428f20 conhost: Don't compare the console config if the user cancels the dialog.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-02 20:17:25 +01:00
Eric Pouech 89a8b32d7a conhost/tests: Add tests for ReadConsoleW with control.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Eric Pouech 68b4ffebfb kernelbase: Return key state in ReadConsoleW with control.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Eric Pouech ef8d44e58e kernelbase: Support CONSOLE_READCONSOLE_CONTROL in ReadConsoleW.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Eric Pouech accacf1a49 conhost/tests: Add tests for shift-tab processing.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 21:31:56 +01:00
Eric Pouech 5b3bc2eeb4 conhost: Handle csi escape sequence for shift tab.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 21:31:56 +01:00
Hugh McMaster 27df7f518c kernelbase: Implement SetCurrentConsoleFontEx.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 10:47:05 +01:00
Eric Pouech 620305d90e conhost: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-04 11:20:33 +01:00
Eric Pouech 7783f021fb conhost/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-03 17:19:41 +01:00
Alex Henrie 78df9cb96c conhost: Fix memory leak on error path in create_screen_buffer (cppcheck).
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-02 18:43:10 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Jacek Caban 288093229d conhost: Remove unused extra_size argument from set_output_info.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-14 20:55:35 +01:00