Commit Graph

575 Commits

Author SHA1 Message Date
Ryan Prichard
afacf7792f Use Appveyor's MSYS2/Cygwin installation rather than my own snapshots
It's simpler to just rely on what Appveyor already provides in its system
images. Appveyor doesn't provide a 32-bit msys2 build, but AFAIK, anyone
needing that can compile it themselves.

Avoid listing gcc-g++ in the Cygwin setup commands because it apparently
breaks the Cygwin toolchain (i.e. missing stddef.h error):
https://ci.appveyor.com/project/rprichard/winpty/builds/19875792
2018-10-29 04:20:06 -07:00
Ryan Prichard
d49712c548 Switch to GitHub prebuilts and add SHA256 checking 2018-10-14 23:53:23 -07:00
Ryan Prichard
784b812663 Add an appveyor config file 2018-10-14 23:08:04 -07:00
Ryan Prichard
ceecad1551 Actually use an XP toolset for XP builds 2018-10-14 22:43:15 -07:00
Ryan Prichard
dcb2df4a4e ship.py: build packages using cygwin/msys2 prebuilts 2018-10-14 22:43:03 -07:00
Ryan Prichard
6aae341b74 ship.py: remove obsolete msys 1.0 mingw32-make code 2018-10-14 19:25:46 -07:00
Ryan Prichard
498a9b1a7f Add util exercising [GS]etConsoleScreenBufferInfoEx
Specifically, allow getting and setting window/buffer size/position.
2018-09-16 20:59:52 -07:00
Ryan Prichard
850661d02b Merge pull request #130 from the-ress/get-console-process-list
Add winpty_get_console_process_list
2017-10-07 20:34:18 -07:00
Tereza Tomcova
f678472b51 Replaced overflow check 2017-10-07 20:33:06 +02:00
Tereza Tomcova
39fe32b15d Fix for edge case when process list changes between GetConsoleProcessList calls 2017-10-04 00:28:05 +02:00
Tereza Tomcova
1424696a6d Add winpty_get_console_process_list 2017-09-16 14:29:23 +02:00
Ryan Prichard
ce9239af5d Update release notes 2017-05-25 20:01:39 -05:00
Ryan Prichard
7d16530ea7 For IntelliJ/JediTerm, allow kBareMod input escapes for navigation keys
Fixes https://github.com/rprichard/winpty/issues/118
2017-05-25 19:49:36 -05:00
Ryan Prichard
4978cf94b6 Go back to using GenerateConsoleCtrlEvent for processed-mode Ctrl-C
This change reverts the first part of the GH-116 fix.

See https://github.com/rprichard/winpty/issues/116
2017-05-19 03:14:13 -05:00
Ryan Prichard
0c86e4f78e Add an entry for Ctrl-C in DefaultInputMap's SimpleEncoding table
Fixes https://github.com/rprichard/winpty/issues/116
2017-05-18 05:04:59 -05:00
Ryan Prichard
c9ce3ad1e3 Use Window messages rather than GenerateConsoleCtrlEvent for Ctrl-C
Fixes https://github.com/rprichard/winpty/issues/116
2017-05-17 06:03:17 -05:00
Ryan Prichard
096f978c7a Flush INPUT_RECORD objects prior to SendMessage/GenerateConsoleCtrlEvent
Fixes https://github.com/rprichard/winpty/issues/117
2017-05-17 05:29:07 -05:00
Ryan Prichard
faf75f74b7 Bump version to 0.4.4-dev 2017-05-17 02:01:42 -05:00
Ryan Prichard
3e1ab962d5 Version 0.4.3 2017-05-17 01:47:20 -05:00
Ryan Prichard
e75bd9cbdd Explicitly use the Unicode function WriteConsoleInputW 2017-05-17 01:47:19 -05:00
Ryan Prichard
6765a41c5b Change the modified-Home/End escape sequence from H/F to 1/4
For unmodified Home/End, winpty instead sends WM_KEYDOWN / WM_KEYUP
messages to the console window so that the console can decide what escape
to use based on the VT terminal "alternate mode".

Fixes https://github.com/rprichard/winpty/issues/114
2017-04-27 21:17:03 -07:00
Ryan Prichard
5814705546 Update release notes 2017-04-24 00:47:14 -07:00
Ryan Prichard
b4db322010 Stop using fonts smaller than 5px in height
The console must decide whether characters are half-vs-full width, and it
seems to make poorer decisions with fonts that are atypically small.  The
console properties dialog doesn't allow fonts smaller than 5px.

For example, (U+2026 HORIZONTAL ELLIPSIS) is half-width in Lucida Console
and Consolas, but with Lucida Console, 2px or 4px height, the console
thinks it's full-width.

Disallowing smaller fonts will force winpty to use larger windows, which
makes it more likely to hit the maximum window size constraint.

See https://github.com/Microsoft/vscode/issues/19665.
2017-04-24 00:38:05 -07:00
Ryan Prichard
af4bc8b78a Update release notes 2017-04-22 23:51:06 -07:00
Ryan Prichard
5b99238fca Don't show the cursor if it is outside the console window
Fixes https://github.com/rprichard/winpty/issues/113
2017-04-22 23:41:22 -07:00
Ryan Prichard
bae43674b1 Update release notes 2017-04-22 22:09:36 -07:00
Ryan Prichard
ac33b66172 Direct mode: invalidate m_bufferData on resize
Also, for efficieny in direct mode, only output the lines that have
changed, rather than reprinting all of the lines after the first changed
line.

Fixes https://github.com/rprichard/winpty/issues/112
2017-04-22 22:05:16 -07:00
Ryan Prichard
d636a1de86 Synthesize a WINDOW_BUFFER_SIZE_EVENT event after winpty is resized
Fixes https://github.com/rprichard/winpty/issues/110.
2017-04-22 14:57:35 -07:00
Ryan Prichard
838d959579 Update the release notes 2017-04-22 03:11:58 -05:00
Ryan Prichard
201d8aeb3a Fix handling of AltGr keys
* Respect the result of VkKeyScan when it returns multiple modifiers.  I
   *think* the old if-else behavior was a typo?

 * Refactor the code to restrict the scope of the Alt-implies-NUL behavior.
   On my US keyboard, if I press either Alt-P or Alt-Ctrl-P, the console
   reports a VirtualKey of 'P', and a NUL codepoint for KeyUp.  For KeyDown,
   though, Alt-P reports a 'P' codepoint, but Alt-Ctrl-P reports a NUL
   codepoint.  winpty previously implemented this logic in appendKeyPress, but
   now it's factored out.

   If the terminal sends us U+20AC (EURO SIGN), VkKeyScan decides that it must
   have been typed using both Ctrl and Alt.  (Pressing Ctrl-LeftAlt-E on my US
   keyboard produces a Euro, as does RightAlt-E; AltGr/RightAlt seems to imply
   Ctrl.)  If the Alt keypress only comes from VkKeyScan, then continue using
   the proper codepoint.

 * Avoid changing the VT/reencoding behavior.  In appendUtf8Char, pass the
   unadjusted codepoint and Alt-escape to appendKeyPress, which will pass it
   to reencodeEscapedKeyPress if the console is using VT input.

Fixes https://github.com/rprichard/winpty/issues/109
2017-04-22 03:11:58 -05:00
Ryan Prichard
6360ec6a5b Add test case demonstrating a Win10 15048 ReadConsoleOutput bug 2017-03-16 20:57:35 -05:00
Ryan Prichard
47e7e005e8 Change program execution: resolve symlinks and do PATH search explicitly
Fixes https://github.com/rprichard/winpty/issues/81
Fixes https://github.com/rprichard/winpty/issues/98
2017-02-01 20:48:43 -06:00
Ryan Prichard
75301a2703 Stop building the MSYS package
See https://github.com/rprichard/winpty/issues/97
2017-02-01 17:53:21 -06:00
Ryan Prichard
9f900cc152 Debug output: when virtualkey is 0, print 0 rather than 0x0 2017-01-31 22:06:06 -06:00
Ryan Prichard
ed9d5ad158 Use hex for scan code --show-input debug output 2017-01-31 22:05:24 -06:00
Ryan Prichard
bf98ff3c20 Add a test program that dumps console input via _getch. 2017-01-31 22:03:52 -06:00
Ryan Prichard
84016539f3 Set the ENHANCED_KEY key state for these keys:
* Arrow keys (up, down, left, right)
 * The block of 6 keys (insert, delete, home, end, pgup, pgdn)

This change fixes arrow keys in the Ruby REPL (irb)

Fixes https://github.com/rprichard/winpty/issues/99
2017-01-31 21:53:26 -06:00
Ryan Prichard
db874f4a70 Bump version 2017-01-18 05:35:39 -06:00
Ryan Prichard
410d634987 Set version to 0.4.2 2017-01-18 05:02:24 -06:00
Ryan Prichard
a703349883 Put the commit hash into the msvc binary package 2017-01-18 04:57:11 -06:00
Ryan Prichard
9fcad3a144 ship: make it easier to spot-check packages by leaving package dirs around 2017-01-18 04:55:55 -06:00
Ryan Prichard
1ad7e4eed8 Release notes for 0.4.2 2017-01-18 02:42:52 -06:00
Ryan Prichard
a674301a4b Fix a build problem with MSYS2 by adding a missing header 2017-01-18 01:29:39 -06:00
Ryan Prichard
eed0b3bd71 Get the code compiling with the latest MinGW.org toolchain.
(MinGW-w64 works already -- only the old MinGW toolchain had trouble.)

 * We need to build the test case with -std=g++11 to provide vsnprintf,
   even though vsnprintf is in C99 and is provided by both MSVC and
   MinGW-w64.

 * The old MinGW provides a non-conforming swprintf.
2017-01-18 01:25:10 -06:00
Ryan Prichard
67a34b6c03 Build system: redo how version number tracking works
* Remove the "version suffix" and BUILD_INFO.txt mechanisms, which I
   believe no one uses except winpty itself.  Instead, a suffix can be
   added in the VERSION.txt file.

 * Instead of passing the version and commit info as a preprocessor macro
   when building every C++ file, write the info into a GenVersion.h
   header that is only included by WinptyVersion.cc.

 * Instead of writing a BUILD_INFO.txt in ship.py, pass COMMIT_HASH=<hash>
   to make.

These changes accomplish two things:

 * People who build a tag from source won't see a "<ver>-dev" suffix
   anymore.

 * Changing the version or the commit will correctly rebuild the version
   object files (and only those object files).  It will also relink every
   binary.

Fixes https://github.com/rprichard/winpty/issues/72
2017-01-17 23:39:14 -06:00
Ryan Prichard
643e14894a Remove an obsolete comment. 2017-01-17 21:50:34 -06:00
Ryan Prichard
36d6a4d82e Support the COMMON_LVB_REVERSE_VIDEO and COMMON_LVB_UNDERSCORE flags
These flags are used with WSL (Bash on Windows) and are commonly used.
(e.g. a pager status bar, man pages, etc.)

The most difficult part of this commit is figuring out when Windows
respects the flags versus ignores them.  Apparently it deliberately
ignores them for backwards-compatibility with some programs.
2017-01-15 06:36:18 -06:00
Ryan Prichard
40d5b72c43 Pass certain keys to the console using windows messages.
If the terminal is placed in an alternate mode using DECCKM, then we
need to generate different input escape sequences for WSL (and other
programs using ENABLE_VIRTUAL_TERMINAL_INPUT).  AFAIK, there is no way
for winpty to detect whether an alternate mode is enabled, but it only
seems to affect a small number of keys, so send those keys as window
messages.

We don't send *all* keys as window messages, because the console may try
to interpret some of them.  It doesn't interpret the arrow keys and
Home/End, AFAICT, and those seem to be the only keys affected by DECCKM.
(The console's line-input mode *does* care about these navigation keys,
but in that case, WriteConsoleInput and window messages work equally well.)

DECCKM only seems to affect the keys when there is no modifier key.

I believe that by using SendMessage, winpty-agent will block until the
keys are appended to the console input buffer.  I'm not sure how to verify
it.  If this *weren't* the case, there could be a danger of key input
being transposed.  It seems unlikely to be an issue.

Fixes https://github.com/rprichard/winpty/issues/90
2017-01-15 04:20:05 -06:00
Ryan Prichard
27dfaaefb6 Bump version to 0.4.2 2017-01-03 23:08:15 -06:00
Ryan Prichard
ff8e67d313 Update release notes for 0.4.1. 2017-01-03 22:16:54 -06:00