1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-18 10:52:16 +03:00
Commit Graph

297 Commits

Author SHA1 Message Date
Wez Furlong
41cfcfdb15 Bring back my original xcb+egl window bits 2018-03-04 07:27:18 -08:00
Wez Furlong
079ac49c6b add guiloop as indirection over glutinloop
... and remove dep on glutin.  We don't properly compile yet,
but this is a step to bringing back the egl bits we had originally.
2018-03-03 22:03:12 -08:00
Wez Furlong
089e98050d reduce deps on glutin in futurecore 2018-03-03 21:47:14 -08:00
Wez Furlong
dac2962c29 factor wakeup into glutinloop 2018-03-03 21:38:06 -08:00
Wez Furlong
7161191e52 factor glutin bits into their own file 2018-03-03 21:23:18 -08:00
Wez Furlong
6623e1ff86 We can now spawn additional windows
However, https://github.com/tomaka/winit/issues/414 makes this unsafe.
2018-03-03 18:48:08 -08:00
Wez Furlong
4089649d8c simplify the TerminalWindow constructor a little more 2018-03-03 17:29:16 -08:00
Wez Furlong
b1a5ebd06f slightly simplify TerminalWindow constructor 2018-03-03 17:21:33 -08:00
Wez Furlong
d7e5df0428 fix typo 2018-03-03 17:15:31 -08:00
Wez Furlong
a387dc0e49 factor out window spawning 2018-03-03 17:10:47 -08:00
Wez Furlong
f7a567b847 share a reference to the config 2018-03-03 16:42:46 -08:00
Wez Furlong
feaad96069 add some comments 2018-03-03 16:13:20 -08:00
Wez Furlong
7a5ba82fa9 cleanup some Drops 2018-03-03 15:50:02 -08:00
Wez Furlong
ce8de2ca03 use futures to manage closing a window 2018-03-03 15:48:36 -08:00
Wez Furlong
f1db5dac40 clippy 2018-03-03 13:00:56 -08:00
Wez Furlong
b945db3bdd migrate sigchld handling to GuiSender 2018-03-03 11:18:51 -08:00
Wez Furlong
ebc4eaab36 move paste over to GuiSender 2018-03-03 11:07:27 -08:00
Wez Furlong
00b45ce350 begin stitching the new mio bits into the gui loop 2018-03-03 10:51:55 -08:00
Wez Furlong
7f5991028b refactor pty thread bits into a more generic remote mio 2018-03-03 09:29:41 -08:00
Wez Furlong
048a6403bc Start building out future executor 2018-03-03 08:14:34 -08:00
Wez Furlong
a9c2578719 more event loop restructuring 2018-03-03 07:30:36 -08:00
Wez Furlong
40bd58b086 move event processing into its own method 2018-03-02 09:02:03 -08:00
Wez Furlong
a8d2472d29 refactor event loop into its own struct 2018-03-02 08:53:38 -08:00
Wez Furlong
377135a71c more shutdown cleanup
We don't print so many stack traces on shutdown, and we now properly
join our threads.

Need to improve how we handle DelPty though.
2018-03-01 23:27:24 -08:00
Wez Furlong
e1001ca289 tidy up session close handling
Return a discrete Fail type for process termination and window
close events.  Handle those a bit more cleanly; when we see that
they've gone, remove things from the maps that we've built.
When there are no more windows left, wind down the event loop.
2018-03-01 22:56:07 -08:00
Wez Furlong
34cc57ceea factor out the pty reading thread 2018-03-01 22:17:05 -08:00
Wez Furlong
6e98b10027 more plumbing to route window events 2018-03-01 21:33:49 -08:00
Wez Furlong
44694fec95 Start building out plumbing for mutiple windows 2018-03-01 21:02:25 -08:00
Wez Furlong
8e68141ab1 Add padding to glyphs in the texture atlas
I've had some reports of some artifacts in some cases and I suspect
that neighboring glyphs were to blame.
2018-03-01 09:24:44 -08:00
Wez Furlong
41f1cf9966 Get the one true descender value 2018-03-01 09:12:31 -08:00
Wez Furlong
0af1be0f40 make it less alarming when showing the lcd filter error msg 2018-03-01 08:18:34 -08:00
Wez Furlong
022083ffde Ugh, meant to amend this into the prior commit 2018-03-01 08:18:19 -08:00
Wez Furlong
82164ba783 Add automatic style rule generation
This looks reasonable with Liberation Sans Mono (which has italics!)
and Deja Vu Sans Mono (which has bold but not italics).

Fixes: https://github.com/wez/wezterm/issues/6
2018-03-01 08:10:21 -08:00
Wez Furlong
4757b93ff3 move these debug messages to debug! rather than eprintln! 2018-02-28 07:42:06 -08:00
Wez Furlong
60e89f6328 Fix latency issue with clipboard/selection handling
We now use mio to select on both the xcb connection and the
channel that we're using to bridge the threads.
2018-02-27 23:56:20 -08:00
Wez Furlong
aad282cb81 and move some more of the clipboard code around 2018-02-27 22:14:10 -08:00
Wez Furlong
451f7b37bb move some more clipboard code around 2018-02-27 22:06:44 -08:00
Wez Furlong
0181a1ccfc refactor clipboard code
No real functional changes, this is just moving some things
around to make it a bit easier to address the laggy selection
handling.
2018-02-27 21:57:17 -08:00
Wez Furlong
27ab1b65a0 Add support for F-keys
Fixes https://github.com/wez/wezterm/issues/11
2018-02-27 08:01:41 -08:00
Wez Furlong
981d939298 More gracefully handle running out of texture space
I manually checked this by setting TEX_SIZE to a small value
and watching the log reallocate progressively larger sizes.
2018-02-24 23:05:20 -08:00
Wez Furlong
f4d3ea6e05 remove stray debug print 2018-02-24 17:35:39 -08:00
Wez Furlong
4092796db3 Fix an issue where the background color rendered gray instead of black
When using the default monospace font on ubuntu (typicaly
DejaVuSansMono), the texture atlas would end up the bottom left pixel
being a shade of gray.

Since we were using (0,0) coords for whitespace cells, all whitespace
cells would appear shaded gray.

We now reserve a black pixel in the bottom left of the underline texture
and switch to that for whitespace instead.

I added Debug support to the ColorPalette while tracking this down,
and figured that I might as well keep it.
2018-02-24 17:28:35 -08:00
Wez Furlong
abc06620b8 add support for implicit hyperlinks 2018-02-24 15:43:02 -08:00
Wez Furlong
478c64e05e Parse command line arguments
We can now run something other than the shell.
2018-02-23 08:41:46 -08:00
Wez Furlong
7af77d34a0 Improve wheel scrolling
We now scroll further if you wheel harder
2018-02-23 08:10:11 -08:00
Wez Furlong
90dd732aee make selected and cursor text fg/bg configurable
Previously we only allowed changing the cursor bg color, now we
get 4 different color settings for this!
2018-02-23 07:57:52 -08:00
Wez Furlong
3f6a1f758b restore original window position when exiting fullscreen
We do some bookkeeping of our own because the get_position() method
appears to return stale data on Linux.
2018-02-23 00:10:42 -08:00
Wez Furlong
d661cf2894 take a stab at hidpi scaling for Jacob
I noticed this looked crazy when he dragged the window between
screens, so maybe this is better?
2018-02-22 23:50:52 -08:00
Wez Furlong
2c74a9fe1b Add primitive Alt-Enter shortcut for fullscreen mode
We'll want to make the bindings configurable in the future.
2018-02-22 23:31:20 -08:00
Wez Furlong
1245bfc065 use text mouse cursor by default, switch to hand cursor on hover 2018-02-22 23:22:08 -08:00
Wez Furlong
1fdbb33010 also need a receiver method 2018-02-22 23:06:50 -08:00
Wez Furlong
4878aef542 factor out clipboard bits as a trait
This will make it easier to plug in macos support later.
2018-02-22 22:53:50 -08:00
Wez Furlong
64c0873ba3 don't fail if lcd filtering is not supported
This was happening on a fedora based distro
2018-02-22 22:14:33 -08:00
Wez Furlong
296c27d3ff rustfmt 2018-02-22 21:16:02 -08:00
Wez Furlong
9673c8c1b7 roll back bundling of harfbuzz
This will likely break travis; I'll follow up with something to help with that.

Refs: https://github.com/wez/wezterm/issues/1
2018-02-22 21:07:17 -08:00
Wez Furlong
4a66bf98ca "centralize" conn.flush()
I've noticed a bit of sluggishness when pasting text from the
terminal and into chrome.  This doesn't fix it, but it moves
things a bit closer to how they should be.
2018-02-22 20:55:03 -08:00
Wez Furlong
6bf691947d fixup sluggish selection dragging 2018-02-22 14:36:06 -08:00
Wez Furlong
6232ebf1c6 make refresh rate more regular 2018-02-22 14:34:57 -08:00
Wez Furlong
c8f3add5cc At is also covered by ReceivedCharacter 2018-02-22 14:28:56 -08:00
Wez Furlong
42323a5be8 plumb clipboard stuff into the wakeup stuff 2018-02-22 09:02:01 -08:00
Wez Furlong
3fb247d22c avoid spurious unhandled warning about these keys 2018-02-22 08:48:20 -08:00
Wez Furlong
d03564aa10 paint after each window input, remember mods for text input
Also need to tweak how we handle ALT-x and CTRL-x as the case of the input
is different with glium vs. xcb
2018-02-22 08:41:51 -08:00
Wez Furlong
697f07cb51 Don't need to worry about MAPPING_NOTIFY events for clipboard 2018-02-22 08:41:27 -08:00
Wez Furlong
79ebf717e8 provide a more targeted channel for wakeups
This allows using the mio poll timer as the signal for drawing
frames, rather than always drawing them after each byte is read
from the pty.   We're using 50ms as the frame interval at the moment.
2018-02-22 01:44:07 -08:00
Wez Furlong
f6a95aafcf use less cpu while idling
This does mean that we paint more frequently (basically after every
read from the pty), so our perf for large files is down.
2018-02-22 01:15:28 -08:00
Wez Furlong
ac7d2a9cda simplify child waiting 2018-02-22 00:35:51 -08:00
Wez Furlong
c9c5b25b01 suppress dead code warning about clip_thread
We want it to live in the struct until it Drops, and the compiler
is helpfully telling us that we don't access it.
2018-02-22 00:23:11 -08:00
Wez Furlong
6f3b6d7018 remove unused x11 dep 2018-02-22 00:19:12 -08:00
Wez Furlong
bd4e745380 go all-in on glutin and remove my own xcb based code 2018-02-22 00:18:10 -08:00
Wez Furlong
3c379978d2 enable paste and link clicking in glutin backend 2018-02-22 00:07:04 -08:00
Wez Furlong
8cb8d7d613 wire up sigchld 2018-02-21 23:51:52 -08:00
Wez Furlong
df0e85abaf hook up input events for glutin 2018-02-21 23:37:19 -08:00
Wez Furlong
ae5910af54 Start breaking the clipboard code out from the window code
This facilitates using the core of glutin without having too much
custom event loop dispatching.
2018-02-21 20:35:58 -08:00
Wez Furlong
d876d23a28 stub for a glutin based window
It can render the terminal but doesn't handle input of any kind.
2018-02-21 00:16:03 -08:00
Wez Furlong
c39dbdc356 stubs for macos font loading 2018-02-20 22:33:09 -08:00
Wez Furlong
a7f2757452 rustfmt update 2018-02-20 22:08:19 -08:00
Wez Furlong
9dadffcf1e fix compile for child waiter on !linux 2018-02-20 21:32:44 -08:00
Wez Furlong
e9e3e47b94 make fontconfig/freetype conditional 2018-02-20 20:55:03 -08:00
Wez Furlong
e2462ea16a refactor rasterizer 2018-02-20 20:49:16 -08:00
Wez Furlong
999396bc45 separate out the fontconfig/freetype code 2018-02-20 20:20:37 -08:00
Wez Furlong
b35fc8a3b1 remove helper method 2018-02-20 19:58:47 -08:00
Wez Furlong
dd4c9d6683 refactor the font loading code
This is the first step towards making this code more system independent.
2018-02-20 19:53:50 -08:00
Wez Furlong
b66f93ad11 add non-linux sigchld waiter 2018-02-20 17:34:32 -08:00
Wez Furlong
a4b55ecffb macos pty api has some mutable ptrs 2018-02-20 17:13:19 -08:00
Wez Furlong
e2529d1837 Move opengl code into its own module 2018-02-20 15:46:05 -08:00
Wez Furlong
4efef794fe move Renderer to its own file
It is now independent of the X11 code
2018-02-20 15:43:42 -08:00
Wez Furlong
39a0b6c9fd extract render code into Renderer class 2018-02-20 15:33:21 -08:00
Wez Furlong
e1cd44922f move x11 code around
idea is to reduce the cfg attributes and make it easier to
split into system dependent renderers
2018-02-20 15:02:39 -08:00
Wez Furlong
5a99dd143c move hbwrap into harfbuzz crate 2018-02-20 14:32:28 -08:00
Wez Furlong
fe1ae0b7eb Be more particular about platform deps 2018-02-20 14:17:28 -08:00
Wez Furlong
e7d99024bb build our own harfbuzz for broader compat 2018-02-20 12:33:30 -08:00
Wez Furlong
9a5e7999da TODONE 2018-02-20 08:13:36 -08:00
Wez Furlong
9da069e1e9 clean up atlas api
We now bubble up an error if we ran out of texture space.
Previously we'd allocate a new texture but that wouldn't help anyone.

I've bumped up the texture size by default, too.

Longer term we should catch this, blow the font cache, cancel the
pending render and re-render.
2018-02-20 08:09:12 -08:00
Wez Furlong
e6f42987ca remove another unused crate 2018-02-20 07:41:19 -08:00
Wez Furlong
5ff473872d Eliminate the third draw call
We can consolidate the underline/strike glyph rendering with
the background layer pass.
2018-02-19 22:02:27 -08:00
Wez Furlong
279b2018fd Render cursor and selection for resized lines
If the user enlarges the terminal we can have regions of the vertex
buffer that have colors that default to alpha channel 0.  This is
normally fine but breaks rendering of the cursor and the selection;
those attributes are out of band from the normal cell attributes,
especially for whitespace cells, so we need to handle those in
the degenerate case at the end of a line render.

Refactor the code that computes the cursor and selection colors
so that we can call it and use it in both places.
2018-02-19 21:29:27 -08:00
Wez Furlong
d55d5855a5 set CLIPBOARD as well as PRIMARY selection when selecting 2018-02-19 20:53:12 -08:00
Wez Furlong
966eb2ce4c Don't loop to read from pty
We don't need to be greedy in handling this read.  It is important
not to for example when a lot of data is being written to the pty
we don't want that to starve the gui event handler and block sending
an interrupt signal.
2018-02-19 07:56:33 -08:00
Wez Furlong
a0faebad8b Clear some rendering artifacts from the rhs of the screen
These would get left behind after making the window wider
and then switching between alt screen and the main screen.
2018-02-19 00:15:11 -08:00
Wez Furlong
52f6e3c0bd tweak the underline position 2018-02-18 23:53:54 -08:00