1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00
Commit Graph

34 Commits

Author SHA1 Message Date
Jalil David Salamé Messina
d541e2e13d fix(clippy): Remove closures where possible
- Removes closures and function calls for types that implement default:

  ```rust
  // Change
  let _my_str = get_str().unwrap_or(String::new);
  // To
  let _my_str = get_str().unwrap_or_default();
  ```

- Uses the `.cloned()/.copied()` methods where possible
- Use function pointer instead of simple closure

May improve performace, as closures generate more code, and this might
unlock some inlining opportunities.
2023-03-19 08:41:38 -07:00
Wez Furlong
f726a2075e deps: remove async-std dep
We were only using block_on from it, which we can call from the
underlying async_io crate.

Notably, removing async_std from the deps avoids async-global-executor
being pulled in and spawning nproc threads that are never used by
wezterm.
2022-11-01 07:05:33 -07:00
Wez Furlong
dd327617b1 lua: add wezterm.time.call_after and wezterm.reload_configuration
These allow setting up some basic timers and constructing time-dependent
config files.

Needs to be used respsonsibly!
2022-07-18 07:37:41 -07:00
Wez Furlong
e8995c5370 wezterm-gui start now prefers to run via existing gui instance
Using the new publish/discovery stuff from the past couple of commits,
if we can find a matching socket path for a running gui, and the
configuration is likely a match, then use the mux protocol to talk
to the already running gui and ask it to spawn the equivalent program
into the same process.

refs: https://github.com/wez/wezterm/discussions/1486
2022-01-07 17:12:35 -07:00
Wez Furlong
7cf68365a5 deps: misc updates 2020-12-29 09:24:34 -08:00
Wez Furlong
fba2159839 deps: remove unused deps
Not all of these are needed in these crates (copypasta resulting
from splitting out modules)
2020-11-20 12:37:38 -08:00
Wez Furlong
18e010f1df deps: normalize the lazy-static version 2020-11-13 08:15:35 -08:00
Wez Furlong
7e8c5a06bb split gui into wezterm-gui executable
This commit moves a bunch of stuff around such that `wezterm` is now a
lighter-weight executable that knows how to spawn the gui, talk to
the mux or emit some escape sequences for imgcat.

The gui portion has been moved into `wezterm-gui`, a separate executable
that doesn't know about the CLI or imgcat functionality.

Importantly, `wezterm.exe` is no longer a window subsystem executable
on windows, which makes interactions such as `wezterm -h` feel more
natural when spawned from `cmd`, and should allow
`type foo.png | wezterm imgcat` to work as expected.

That said, I've only tested this on linux so far, and there's a good
chance that something mac or windows specific is broken by this
change and will need fixing up.

refs: #301
2020-10-24 16:40:15 -07:00
Wez Furlong
5fb1414b69 fix clipboard on x11
This was broken by the changes in
aad493ab2a.  The issue was that the
channel send didn't wakeup the receiver.  I'm not sure why, and I tried
a couple of different async channel implementation.

Doing the simplistic solution here works reliably.
2020-10-09 11:07:18 -07:00
Wez Furlong
aad493ab2a simplify promise crate
Implement Future and Promise in terms of a bounded channel of size 1.
2020-10-05 08:50:29 -07:00
Wez Furlong
5eb4d32004 upgrade misc deps, notably, async-task 2020-10-05 00:06:01 -07:00
Wez Furlong
3de4851aed fixup tls mux sessions
This adopts smol more broadly, but not yet completely.
2020-10-04 21:47:12 -07:00
Wez Furlong
e8be716cb3 clean up mux server startup
kindof a lot going on in this commit, unintentionally:

* Need the lua context set to be moved into the config crate
  otherwise configs cannot be parsed by the server and we end
  up with the default configs
* Make the server use smol for async io
* Drop the use of the daemonize crate, which I had forked anyway.
  Just inline our own tighter daemonize module
* Improve daemon spawning synchronization, however, it still needs
  work for windows to avoid blocking forever where we don't do
  daemonizing.
2020-10-04 09:39:28 -07:00
Wez Furlong
1d9678706c promise: add tokio_spawn helper
This starts up the tokio runtime on a secondary thread
and spawns a future into it.
2020-01-20 07:55:51 -08:00
Wez Furlong
27d58ae371 promise: remove Executors 2020-01-16 23:29:42 -08:00
Wez Furlong
aeb91ff238 migrate more things over to the new spawn stuff 2020-01-16 10:31:53 -08:00
Wez Furlong
9ec4694d89 migrate some more code to the newer spawn mechanism 2020-01-16 09:15:07 -08:00
Wez Furlong
75eb16bec4 move spawn_task into a new promise::spawn module 2020-01-16 03:50:48 -08:00
Wez Furlong
9a2c7a1485 failure -> anyhow + thiserror 2019-12-14 21:43:05 -08:00
Wez Furlong
14fbf43485 promise: more properly implement Future::poll
The future won't ever complete if you don't connect the waker
from the context!

Prove this out by making the windowops functions async and
verifying them in the async example
2019-11-23 08:16:12 -08:00
Wez Furlong
61fe33fbf6 remove unused rayon dep from the promise crate 2019-10-28 14:31:10 -07:00
Wez Furlong
0579a52f77 promise: clippy 2019-10-07 07:22:34 -07:00
Wez Furlong
6047229bf2 potentially make our promise/future crate await compatible 2019-09-15 19:09:08 -07:00
Wez Furlong
cab062118b promise: split execute out to BasicExecutor
This makes it easier to implement just the scheduling portion
without imposing other restrictions on the executor type.
2019-09-15 19:09:08 -07:00
Wez Furlong
d67d4aab57 avoid marking a tab as dead when we might reconnect it 2019-06-29 16:31:13 -07:00
Wez Furlong
55caafb0c4 more properly fix cond notify on Promise::drop 2019-06-16 21:04:53 -07:00
Wez Furlong
99d6c12532 poll the client tab asynchronously
Restructure the poll routine so that we don't block the gui thread
while we wait for the render data to be returned from the server.
2019-06-14 20:30:45 -07:00
Wez Furlong
5ebad9e63a dyn everywhere 2019-06-08 21:28:11 -07:00
Wez Furlong
038100922a clippy 2019-05-26 12:49:10 -07:00
Wez Furlong
e1a1530d22 remove boxfnonce: now require rust 1.35+
Rust can now naturally deal with with these constructs, so drop the
external crate.
2019-05-26 09:14:20 -07:00
Wez Furlong
1f9d95d57f tweak executor trait for compat with x11 2019-03-04 23:13:37 +00:00
Wez Furlong
2bfc4fe401 fix warning 2019-03-04 22:44:09 +00:00
Wez Furlong
4b4be6ac21 remove futurecore 2019-03-04 22:32:59 +00:00
Wez Furlong
1d37e44b62 move promise to its own crate 2019-03-04 15:38:56 +00:00