1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 19:27:22 +03:00
Commit Graph

134 Commits

Author SHA1 Message Date
Wez Furlong
40386b964c only print unhandled IME commands 2019-11-03 22:01:35 -08:00
Wez Furlong
ea25055d42 add a couple of missing IME operations -> KeyCode 2019-11-03 22:01:35 -08:00
Wez Furlong
8d32bbf49e remove some key debug prints on macos 2019-11-03 22:01:35 -08:00
Wez Furlong
c99e2989ef Fix ctrl-J processing
The front-end was treating both \r and \n as Enter and passing
that through to the terminal.

To verify behavior, pay attention to your termios configuration:

```
$ stty -icrnl
$ od -c
<CTRL-J><CTRL-D>
0000000   \n
0000001
$ od -c
<CTRL-M><CTRL-D><Enter>
0000000   \r  \n
0000002
```

Closes https://github.com/wez/wezterm/issues/56
2019-11-03 22:01:35 -08:00
Wez Furlong
bb637e9884 improve coverage of macos function key -> KeyCode 2019-11-03 22:01:35 -08:00
Wez Furlong
61f4a8d32a Add basic support for IME on macOS
Similar to the windows IME support, the placement needs refinement, but
this is sufficient for pinyin input and insertion of emoji via the emoji
palette.
2019-11-03 22:01:35 -08:00
Wez Furlong
81ec2a8a26 find a better way to decide that the IME is active on windows
wparam is set to VK_PROCESSKEY so gate on that; this helps to prevent
emitting the initial character of a composition sequence to the
terminal.
2019-11-02 18:08:18 -07:00
Wez Furlong
f88fed9dfb don't swallow things like ctrl+ 2019-11-02 13:42:10 -07:00
Wez Furlong
da58b36881 Improve? IME on Windows
This isn't perfect, but is sufficient to allow using the IME to enter
eg: the heart emoji with cmd.exe.

We have some issues locating and rendering chinese characters that
make it difficult to prove/disprove that the IME is working 100%
because we just can't see the glyphs.

In addition, there appears to be something a bit wonky with conpty and
emoji.  If we use eg: `wezterm ssh HOST` to log in to a remote system,
and use the IME to pick eg: the pig face emoji, this renders correctly.
In that scenario we don't use conpty at all.

The IME window is always placed in the top left corner of the window
at the moment, which isn't great, but is better than the system default
which is outside of the window.  I need to introduce a way to set the
IME position in the window layer so that the front end gui can set it
to the current cursor position.
2019-11-02 12:39:05 -07:00
Wez Furlong
30c6ac7831 fix formatting 2019-10-28 07:37:10 -07:00
Wez Furlong
e8dbf18bb6 avoid ambiguous resolution in cargo test --all 2019-10-28 00:18:46 -07:00
Wez Furlong
d80169ceff Avoid accidental application mode delete output in key processing
I thought that I'd broken something with the DEL processing in vim with
the new frontend but it turned out that the other frontend was emitting
BS always and that I'd actuall unbroken passing DEL through and that
other layers were translating DEL into an application cursor mode output
for DEL that emits a totally different sequence.

This diff preserves DEL and disables that other sequence.

Will follow up with some explicit configuration to control this
behavior, but in the short term, the default behavior should be much
closer to what people actually want and expect!

refs: https://github.com/wez/wezterm/issues/52
2019-10-27 23:59:15 -07:00
Wez Furlong
66f5f6842d implement window size changing when the font scaling is changed on windows 2019-10-27 18:13:02 -07:00
Wez Furlong
c5d9766d50 x11: implement window resizing when font scaling changes 2019-10-27 17:58:37 -07:00
Wez Furlong
4e01dec636 font scaling now also resizes the window for opengl+software frontend 2019-10-27 17:48:02 -07:00
Wez Furlong
fd8738ea0e window: macos: rewrite Del to Backspace
this is more appropriate for vim
2019-10-27 16:33:48 -07:00
Wez Furlong
4116d7d523 remove byte-swapping workaround for opengl
We handle this with a temporary buffer for the upload, which is
a little gross but avoids leaking that implementation aspect
out to the rest of the code.
2019-10-27 10:07:14 -07:00
Wez Furlong
3a7f4cdff2 explicitly select a 24-bit visual on x11 2019-10-27 09:07:52 -07:00
Wez Furlong
04d6fed848 fixup tests for recent api changes 2019-10-27 09:04:42 -07:00
Wez Furlong
d97a84f984 render iterm2 image protocol in the software renderer
This is still a bit rough because the terminal parser doesn't
understand the pixel sizes, so it relies on the hard coded
cell dimensions being accurate.
2019-10-26 23:30:39 -07:00
Wez Furlong
71b4f52e5e clippy 2019-10-26 13:22:16 -07:00
Wez Furlong
f2fce18586 window: use wgl for opengl on windows 2019-10-24 19:12:18 -07:00
Wez Furlong
5135c724e6 window: fixup windows build for egl changes 2019-10-24 17:48:49 -07:00
Wez Furlong
7c2afce851 implement EGL based render for termwindow/opengl mode on linux 2019-10-24 17:43:37 -07:00
Wez Furlong
0e95f00a52 window: remove debug print on x11 2019-10-24 16:03:32 -07:00
Wez Furlong
6a96b7ddea window: take a stabe at EGL for linux/windows
This doesn't initialize it at all properly yet, but is groundwork
for completing that work in a later commit
2019-10-24 15:54:41 -07:00
Wez Furlong
f57b5deb80 allow compiling on win and linux 2019-10-24 10:37:40 -07:00
Wez Furlong
c6ce005b2a make new opengl frontend basically work on macos
It doesn't yet handle underlines or strikethrough.
Notably, live resizing now works, which is nice!
2019-10-24 08:27:11 -07:00
Wez Furlong
41e392fc79 we can now init opengl but not render it 2019-10-10 08:15:00 -07:00
Wez Furlong
999e651b17 window: impl Texture2d for SrgbTexture2d 2019-10-07 08:34:54 -07:00
Wez Furlong
2a19850350 add opengl frontend that sits on top of the window code
This uses the same plumbing as the software frontend, but tries
to enable opengl.

None of the opengl rendering is plumbed through here yet, so this
is currently functionally identical to the software renderer.
2019-10-07 07:51:49 -07:00
Wez Furlong
378e7b326f only use simd if the region is wide enough
Refs: https://github.com/wez/wezterm/issues/40
2019-10-07 07:41:11 -07:00
Wez Furlong
89a0046f5a window: A basic opengl capability 2019-10-07 07:17:57 -07:00
Wez Furlong
85311373a5 clippy 2019-10-01 22:20:52 -07:00
Wez Furlong
29095f8560 software: remove a little bit of overhead from draw_image 2019-09-30 08:36:23 -07:00
Wez Furlong
b2212c3105 software: improve alpha blending for draw_line 2019-09-30 08:17:47 -07:00
Wez Furlong
b5e07005b7 software: fix aligment check 2019-09-30 07:52:31 -07:00
Wez Furlong
b0efba9300 improve linear f32 -> srgb8 conversion
This uses a combination of lookup tables and simd to reduce the
cpu utilization by about ~15% compared to the prior brute force
implementation.
2019-09-30 00:45:35 -07:00
Wez Furlong
07fcc96f5a window: disable alignment based optimization for fill_pixel 2019-09-29 20:59:20 -07:00
Wez Furlong
1e25003cb6 speed up rgb conversion from u8 -> linear f32 2019-09-29 20:52:47 -07:00
Wez Furlong
c6fd88d8c5 add basic simd support for clearing rectangles 2019-09-29 20:24:26 -07:00
Wez Furlong
569408de66 software: handle OutOfTextureSpace condition 2019-09-29 12:42:51 -07:00
Wez Furlong
91e6bb4a5a rustfmt 2019-09-29 12:29:34 -07:00
Wez Furlong
99579bfca2 make it possible to build async example on stable rust
This should make the CI a bit happier
2019-09-28 22:00:07 -07:00
Wez Furlong
1c5f20f5e5 window: impl close for Windows 2019-09-28 21:16:08 -07:00
Wez Furlong
d44f380a82 window: impl close method on x11 2019-09-28 21:01:18 -07:00
Wez Furlong
950a7d2b22 cargo fix dyn 2019-09-28 20:29:48 -07:00
Wez Furlong
7e09492606 Add close operation on macos 2019-09-28 17:46:43 -07:00
Wez Furlong
dd1621e693 window: fixup mouse coords on macos hidpi display 2019-09-28 10:29:47 -07:00
Wez Furlong
389c477b16 software: ligatures now render, but scaled emoji need work 2019-09-28 10:06:47 -07:00