Commit Graph

25 Commits

Author SHA1 Message Date
Timon
5d50d8da62
Minor upgrade to crossterm 0.28 (#898) 2024-07-31 19:41:00 +02:00
Timon
9fb2e0dafd
Update dependencies (#809) 2023-08-06 14:18:21 +02:00
Dave
00f7d06151
[testing] serial testing perserving terminal (#791)
This change does two things:
- add the serial_test crate to run selected tests serial rather
  than in parallel. This is done because they use global state
  so running them in parallel leads to race conditions and flaky
  results (sometimes they pass, sometimes they fail). Running
  them serialy avoids this flakiness.
- create a screen buffer within the test. This avoids changing
  the terminal (screen buffer) which is running the test. for
  example, a test that changes the terminal size to 20 x 20 can
  leave the developer running the test with a resized terminal.
  Creating a separate screen buffer for the test avoids this.
2023-08-05 15:36:42 +02:00
Benjamin Grosse
10c54b0056
Add window_size() for unix (#790)
It is possible to render images in terminals with protocols such as Sixel,
iTerm2's, or Kitty's. For a basic sixel or iTerm2 image printing, it is
sufficient to print some escape sequence with the data, e.g. cat image just
works, the image is displayed and enough lines are scrolled.

But for more sophisticated usage of images, such as TUIs, it is necessary to
know exactly what area that image would cover, in terms of columns/rows of
characters. Then it would be possible to e.g. resize the image to a size that
fits a col/row area precisely, not overdraw the image area, accommodate layouts,
etc.

Thus, provide the window size in pixel width/height, in addition to cols/rows.

The windows implementation always returns a "not implemented" error. The
windows API exposes a font-size, but in logical units, not pixels.

This could be further extended to expose either "logical window size",
or "pixel font size" and "logical font size".
2023-08-05 15:34:27 +02:00
gibbz00
a2c9350ff2
Unwrap crossterm::Result<T, ErrorKind> to std::io::Result. (#765) 2023-04-07 18:17:10 +02:00
Timon
03c25178af
Make the events module an optional feature (#776) 2023-04-07 17:09:15 +02:00
Timon
318f810a39
Support key release events for windows. (#745) 2023-01-28 11:05:31 +01:00
Jonathan
814df1c4a0
Fix CI failures (#746) 2023-01-12 21:04:29 +01:00
Michael Davis
3fe13e18d8
Add a function for checking keyboard enhancement support (#732)
* Add a function for checking keyboard enhancement support

This follows the Kitty documentation's recommended way to check for
progressive keyboard enhancement: query the flags and then query the
primary device attributes (which is broadly supported). If we receive
only the device attributes, the protocol is not supported.

* Check keyboard enhancement in the event-read example
2023-01-10 19:23:34 +01:00
Timon
f909b3db95
0.21 (#596) 2021-08-23 19:07:55 +02:00
Canop
ec1ed6879e
Expose is_raw_mode_enabled() function (#592) 2021-08-13 13:13:37 +02:00
Timon
a618a9f3b3
0.20 (#567) 2021-06-10 15:55:34 +02:00
Kestrer
e1260446e9
Remove writer parameter from execute_winapi (#570) 2021-06-10 15:20:00 +02:00
Plecra
58f580eaad
crossterm::ErrorKind to io::Error (#553) 2021-04-13 08:46:51 +02:00
Koxiaet
6a1114b241
Support taking any Display in SetTitle (#528) 2020-12-30 18:50:44 +01:00
Koxiaet
0797441893
Make imports & docs more consistent (#524) 2020-12-28 09:47:20 +01:00
Barret Rennie
dfafcc09ac
Make windows raw_mode act on CONIN$ 2020-07-02 13:52:09 +02:00
Matheus Lessa Rodrigues
88add302cd
Implementing SetTitle command (#429) 2020-05-16 07:41:43 +02:00
Timon
e35d4d2c1c 0.15.1 (#381) 2020-02-08 14:23:50 +01:00
Timon
71029c4a87
Moved some files around (#342) 2019-12-11 17:10:34 +01:00
Timon
b4241e0107
Refactored Screen Module (#336) 2019-12-04 17:40:11 +01:00
Zrzka
011a47e93d
Add clippy (#323)
Signed-off-by: Robert Vojta <rvojta@me.com>
2019-11-19 12:18:24 +01:00
Timon
f597cfd232
Input module Rewrite (#284) 2019-11-18 21:50:57 +01:00
John-John Tedro
9690e5bc38 Remove reader thread in AsyncReader (#309) 2019-11-08 06:53:10 +01:00
Timon
3ab5b170aa
Terminal remove Deprecated Api (#293) 2019-10-29 09:14:47 +01:00