1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-03 19:53:40 +03:00
Commit Graph

635 Commits

Author SHA1 Message Date
Wez Furlong
74da631430
mux: allow client to provide palette to mux server
The server-side ownership of the palette is a stumbling block for
many users, so let's fix it.

This commit allows the client to pass its configured palette to
the server when it connects, and when the config is changed.

That palette takes precedence over the palette from the server config.

However, if the remote application uses any escape sequences that
redefine the color palette, the color palette that was active at
that point in time is forked and use as the basis, and will remain
the active palette until the palette is reset via escape sequences.

refs: https://github.com/wez/wezterm/issues/2686
refs: https://github.com/wez/wezterm/issues/3397
2023-03-31 08:02:32 -07:00
Wez Furlong
d6e8271b5b
update libssh-rs dep to latest build
Don't need to point to the git repo for this any more, just
use the published release.
2023-03-30 06:39:56 -07:00
Wez Furlong
1e688a5128
Add serial_ports config
This commit teaches the config about SerialDomains, and the mux
layer about constructing a SerialDomain, then changes the GUI
layer to use those pieces to set up `wezterm serial`.

A new `serial_ports` config is added, and the GUI layer knows how
to apply it to the set of domains in the mux.

The result of this is that you can now define a domain for each
serial port and spawn a serial connection into a new tab or window
in your running wezterm gui instance.
2023-03-29 19:05:13 -07:00
Wez Furlong
a5b52de02c
populate ssh domains from your ssh config by default
If you haven't assigned `config.ssh_domains` to something else,
this commit will populate it from the hosts it finds in your
ssh config file.

First it will emit no-multiplexing entries that allow ad-hoc
ssh connections.

Then it will emit wezterm multiplexing enabled versions of those
entries.
2023-03-29 11:51:59 -07:00
Wez Furlong
ea92df9486
mux server: propagate config CLI options when daemonizing
refs: #3397
2023-03-29 05:40:15 -07:00
Wez Furlong
8092886146
windows: add manifest to config-using console apps, force UTF8 ACP
Lua appears to populate package.path to something based on the
executable path on windows, but since it uses msvcrt in ANSI mode,
that string is encoded in whatever 8-bit MBCS is configured by
the host system ACP setting.

Rust expects that to be UTF-8, but Windows doesn't guarantee it.

This commit updates the manifest for wezterm-gui to tell Windows
that it wants its ACP to be set to UTF-8 prior to launch, which
should resolve this situation for the GUI.

This commit also introduces a more cut-down manifest for the
console-subsystem executables that also use the lua config layer,
which should hopefully resolve this issue for them.

This commit was authored on a mac, so fingers crossed that it
even compiles properly on windows!

refs: https://github.com/wez/wezterm/issues/3390
2023-03-28 19:18:48 -07:00
Wez Furlong
a7fde7935b
raise ulimit nofile and nproc to a reasonable min value on unix systems
It's a tremendous PITA for the user to do this at the system level on a
mac, where it is sorely needed.  This commit allows raising to a desired
minimum level, but won't decrease from an already larger soft limit.

refs: https://github.com/wez/wezterm/discussions/3353
2023-03-28 07:29:47 -07:00
Jalil David Salamé Messina
2315834109 fix: Use serde with bitflags 2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
9f6595d76e chore: Update Cargo.lock 2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
fc5e8b4f3d fix: Update signal-hook to 0.3 and fix compilation errors
- Some functions are now under the `low_level` module, use that
2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
05df6ec054 chore: Update nix to 0.26 2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
7f89f46ae5 fix: Update bitflags to 2.0 and fix compilation errors
- v2.0 no longer derives a bunch of traits (Debug, Clone, Copy, PartialEq, Eq)
  by default, so I manually derived them.
- It also changed the snapshot results so I updated them:

  An empty bitflags struct is no longer displayed as `None` but as
  `BitFlags(0x0)`.

- `bits` is no longer a field but a method so I added the missing
  parenthesis.
2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
7721126fdd chore: Update phf to 0.11 2023-03-27 07:38:55 -07:00
Wez Furlong
5b51179265
deps: update sha2
closes: https://github.com/wez/wezterm/pull/3379
2023-03-26 19:50:53 -07:00
Wez Furlong
6ee68b2b17
cargo update 2023-03-26 19:49:36 -07:00
Wez Furlong
2a2b075d71
cargo update 2023-03-25 11:36:01 -07:00
Wez Furlong
2e488d57c7
update terminfo to 0.8 2023-03-24 10:12:49 -07:00
Wez Furlong
bc7acc18e0
fixup images with the multiplexer
* Translate from File to EncodedFile as needed
* Adopt blob leases in the mux server
* Fix an issue where the first image sent by the mux server would
  be replaced on the client by its background image, if configured.
  Removed the ImageData::id field to resolve this: you should use
  the hash field instead to identify and disambiguate images.
  Bumped the termwiz API version because this is conceptually
  a breaking change to the API

refs: https://github.com/wez/wezterm/issues/3343
2023-03-23 21:43:28 -07:00
Wez Furlong
f56069e279
wezterm-ssh: fix occasional segv on libssh shutdown
The shutdown is due to an openssl race condition:
refs: https://github.com/openssl/openssl/issues/6214

which is worked around by explicitly telling it not
to shutdown at process exit in:
refs: https://github.com/sfackler/rust-openssl/pull/1324

The mitigation is in the updated libssh crate, so bump it
to pull it in.

This makes `cargo nextest run` run clean for me on linux.
2023-03-23 13:44:00 -07:00
Wez Furlong
c66014d36e
cargo update 2023-03-22 18:03:45 -07:00
Wez Furlong
4913817067
allow json encoding wezterm.GLOBAL entries 2023-03-22 09:30:02 -07:00
Wez Furlong
73a1c3b0d3
docs: add --help output pages to the CLI reference 2023-03-21 18:44:26 -07:00
Wez Furlong
a6f857c14f
deps: update predicates for wezterm-ssh tests 2023-03-19 23:00:25 -07:00
dependabot[bot]
9fb07f20cd build(deps): bump rstest from 0.16.0 to 0.17.0
Bumps [rstest](https://github.com/la10736/rstest) from 0.16.0 to 0.17.0.
- [Release notes](https://github.com/la10736/rstest/releases)
- [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/la10736/rstest/compare/0.16.0...0.17.0)

---
updated-dependencies:
- dependency-name: rstest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-19 22:19:11 -07:00
Wez Furlong
51d7b28fb5
cargo update 2023-03-19 20:20:34 -07:00
Wez Furlong
060d0f1ed4
remove open dependency
refs: https://github.com/wez/wezterm/issues/3288
2023-03-19 13:12:20 -07:00
Wez Furlong
f5ba73a1a2
add own open_url crate
The upstream open crate keeps making stuff async/blocking/not-working on
windows, so this is a step towards removing this dependency.

refs: https://github.com/wez/wezterm/issues/3288
2023-03-19 12:44:12 -07:00
Wez Furlong
344a41f944
use blob leases for decoded animation frames
This allows the decoder thread to live only long enough
to decode the full set of frames; we can then store the
leases in memory and pull them in only when there is
a cache miss.

refs: https://github.com/wez/wezterm/issues/3263
2023-03-18 21:55:57 -07:00
Wez Furlong
7cd0cc21bf
ImageDataType::File -> EncodedLease
Adopt the new blob lease layer to storing and referencing
image files.

This reduces the number of open files needed when
images are being displayed in the terminal.

refs: https://github.com/wez/wezterm/issues/3263
2023-03-18 20:32:49 -07:00
Wez Furlong
6c86bfba39
add wezterm-blob-leases crate 2023-03-18 20:30:47 -07:00
Wez Furlong
01c7b30247
cargo update 2023-03-17 12:02:21 -07:00
Wez Furlong
e090eb9eae
Image decoding is now done in a bg thread
Continuing from the previous commit, this shifts:

* In-memory data -> temporary file
* Image decoding -> background thread

The background thread asynchronously decodes frames and
sends them to the render thread via a bounded channel.

While decoding frames, it writes them, uncompressed, to
a scratch file so that when the animation loops, it is
a very cheap operation to rewind and pull that data
from the file, without having to burn CPU to re-decode
the data from the start.

Memory usage is bounded to 4 uncompressed frames while
decoding, then 3 uncompressed frames (triple buffered)
while looping over the rest.

However, disk usage is N uncompressed frames.

refs: https://github.com/wez/wezterm/issues/3263
2023-03-17 11:41:20 -07:00
Wez Furlong
aa929a1a9b
move animation decoding from term layer to gui layer
This makes decoding animation frames a lazy operation, but it
comes at the cost of needing to re-decode the image from scratch
when it loops, because the image crate doesn't provide a way
to rewind its frame iterator.

That initial decode can have a significant time cost; a small
webp file consistently takes 150ms to decode, which is too
much to do inline in the render thread.

Next steps will be to move that cost off the render thread.
2023-03-17 11:41:20 -07:00
Wez Furlong
97452d0ccc
term: improve readability of error message for oversized image
refs: https://github.com/wez/wezterm/issues/3264
2023-03-16 22:41:52 -07:00
Wez Furlong
2bfb29f1be
improve handling of animated webp images
Use mainline image crate to avoid an otherwise unavoidable panic
in the upstream: https://github.com/image-rs/image/issues/1775

Explicitly operate on the frames from the animation.

refs: https://github.com/wez/wezterm/issues/3250
2023-03-15 11:34:47 -07:00
Waleed Khan
4afedd626d build(pty): don't use std::os::fd::RawFd symbol directly
For whatever reason, `portable-pty` doesn't build until Rust v1.66 due to a failure to import `std::os::fd::RawFd`. According to `cargo-msrv`:

```
$ cargo msrv --linear
Fetching index
Determining the Minimum Supported Rust Version (MSRV) for toolchain aarch64-apple-darwin
Using check command cargo check
 ⠲ Checking 1.68.0                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
 ⠴ Checking 1.68.0                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Check for toolchain '1.68.0-aarch64-apple-darwin' succeeded
Check for toolchain '1.67.1-aarch64-apple-darwin' succeeded
Check for toolchain '1.66.1-aarch64-apple-darwin' succeeded

Check for toolchain '1.65.0-aarch64-apple-darwin' failed with:
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Compiling libc v0.2.139                                                                                                               │
│    Compiling autocfg v1.1.0                                                                                                           │
│     Checking cfg-if v1.0.0                                                                                                            │
│    Compiling proc-macro2 v1.0.51                                                                                                      │
│    Compiling quote v1.0.23                                                                                                            │
│    Compiling syn v1.0.109                                                                                                             │
│    Compiling unicode-ident v1.0.8                                                                                                     │
│    Compiling version_check v0.9.4                                                                                                     │
│    Compiling pkg-config v0.3.26                                                                                                       │
│    Compiling memchr v2.5.0                                                                                                            │
│     Checking bitflags v1.3.2                                                                                                          │
│     Checking once_cell v1.17.1                                                                                                        │
│    Compiling log v0.4.17                                                                                                              │
│    Compiling num-traits v0.2.15                                                                                                       │
│    Compiling futures-core v0.3.26                                                                                                     │
│    Compiling crossbeam-utils v0.8.15                                                                                                  │
│    Compiling serde_derive v1.0.152                                                                                                    │
│    Compiling thiserror v1.0.39                                                                                                        │
│    Compiling serde v1.0.152                                                                                                           │
│    Compiling jobserver v0.1.26                                                                                                        │
│     Checking pin-project-lite v0.2.9                                                                                                  │
│    Compiling cc v1.0.79                                                                                                               │
│     Checking getrandom v0.2.8                                                                                                         │
│     Checking scopeguard v1.1.0                                                                                                        │
│    Compiling ahash v0.7.6                                                                                                             │
│     Checking futures-sink v0.3.26                                                                                                     │
│     Checking futures-io v0.3.26                                                                                                       │
│    Compiling slab v0.4.8                                                                                                              │
│     Checking lazy_static v1.4.0                                                                                                       │
│    Compiling lock_api v0.4.9                                                                                                          │
│     Checking smallvec v1.10.0                                                                                                         │
│     Checking num_cpus v1.15.0                                                                                                         │
│    Compiling num-integer v0.1.45                                                                                                      │
│    Compiling siphasher v0.3.10                                                                                                        │
│    Compiling rand_core v0.6.4                                                                                                         │
│     Checking fastrand v1.9.0                                                                                                          │
│    Compiling rand v0.8.5                                                                                                              │
│    Compiling phf_shared v0.11.1                                                                                                       │
│    Compiling memoffset v0.8.0                                                                                                         │
│     Checking adler v1.0.2                                                                                                             │
│     Checking pin-utils v0.1.0                                                                                                         │
│    Compiling indexmap v1.9.2                                                                                                          │
│    Compiling futures-channel v0.3.26                                                                                                  │
│    Compiling libz-sys v1.1.8                                                                                                          │
│    Compiling anyhow v1.0.69                                                                                                           │
│     Checking hashbrown v0.12.3                                                                                                        │
│    Compiling phf_generator v0.11.1                                                                                                    │
│    Compiling futures-task v0.3.26                                                                                                     │
│     Checking miniz_oxide v0.6.2                                                                                                       │
│     Checking socket2 v0.4.9                                                                                                           │
│    Compiling crossbeam-epoch v0.9.14                                                                                                  │
│    Compiling futures-util v0.3.26                                                                                                     │
│    Compiling crc32fast v1.3.2                                                                                                         │
│     Checking strsim v0.10.0                                                                                                           │
│     Checking crossbeam-channel v0.5.7                                                                                                 │
│     Checking fnv v1.0.7                                                                                                               │
│    Compiling typenum v1.16.0                                                                                                          │
│    Compiling memoffset v0.6.5                                                                                                         │
│     Checking event-listener v2.5.3                                                                                                    │
│     Checking byteorder v1.4.3                                                                                                         │
│     Checking concurrent-queue v2.1.0                                                                                                  │
│     Checking parking v2.0.0                                                                                                           │
│    Compiling rayon-core v1.11.0                                                                                                       │
│     Checking waker-fn v1.1.0                                                                                                          │
│     Checking async-lock v2.7.0                                                                                                        │
│     Checking futures-lite v1.12.0                                                                                                     │
│     Checking signal-hook-registry v1.4.1                                                                                              │
│     Checking crossbeam-deque v0.8.3                                                                                                   │
│    Compiling generic-array v0.14.6                                                                                                    │
│     Checking flate2 v1.0.25                                                                                                           │
│     Checking spin v0.9.5                                                                                                              │
│     Checking nanorand v0.7.0                                                                                                          │
│     Checking aho-corasick v0.7.20                                                                                                     │
│    Compiling polling v2.5.2                                                                                                           │
│     Checking regex-syntax v0.6.28                                                                                                     │
│    Compiling ucd-trie v0.1.5                                                                                                          │
│     Checking either v1.8.1                                                                                                            │
│    Compiling phf_codegen v0.11.1                                                                                                      │
│    Compiling lua-src v544.0.1                                                                                                         │
│    Compiling luajit-src v210.4.5+resty2cf5186                                                                                         │
│    Compiling nom v5.1.2                                                                                                               │
│    Compiling num-rational v0.4.1                                                                                                      │
│     Checking rayon v1.7.0                                                                                                             │
│    Compiling async-io v1.12.0                                                                                                         │
│     Checking weezl v0.1.7                                                                                                             │
│     Checking regex-automata v0.1.10                                                                                                   │
│     Checking async-task v4.3.0                                                                                                        │
│     Checking simd-adler32 v0.3.4                                                                                                      │
│    Compiling core-foundation-sys v0.8.3                                                                                               │
│     Checking base64 v0.21.0                                                                                                           │
│     Checking tinyvec_macros v0.1.1                                                                                                    │
│     Checking rustc-hash v1.1.0                                                                                                        │
│     Checking lab v0.11.0                                                                                                              │
│    Compiling tinyvec v1.6.0                                                                                                           │
│     Checking zune-inflate v0.2.50                                                                                                     │
│    Compiling mlua v0.8.8                                                                                                              │
│     Checking regex v1.7.1                                                                                                             │
│    Compiling terminfo v0.7.5                                                                                                          │
│     Checking png v0.17.7                                                                                                              │
│     Checking threadpool v1.8.1                                                                                                        │
│     Checking dirs-sys v0.3.7                                                                                                          │
│     Checking percent-encoding v2.2.0                                                                                                  │
│     Checking half v2.2.1                                                                                                              │
│     Checking lebe v0.5.2                                                                                                              │
│     Checking color_quant v1.1.0                                                                                                       │
│     Checking bit_field v0.10.2                                                                                                        │
│     Checking form_urlencoded v1.1.0                                                                                                   │
│     Checking gif v0.11.4                                                                                                              │
│     Checking unicode-normalization v0.1.22                                                                                            │
│     Checking dirs v4.0.0                                                                                                              │
│     Checking jpeg-decoder v0.3.0                                                                                                      │
│     Checking block-buffer v0.9.0                                                                                                      │
│     Checking digest v0.9.0                                                                                                            │
│     Checking async-channel v1.8.0                                                                                                     │
│     Checking phf_shared v0.10.0                                                                                                       │
│    Compiling libgit2-sys v0.14.2+1.5.1                                                                                                │
│     Checking cpufeatures v0.2.5                                                                                                       │
│     Checking unicode-bidi v0.3.10                                                                                                     │
│     Checking utf8parse v0.2.0                                                                                                         │
│     Checking opaque-debug v0.3.0                                                                                                      │
│    Compiling thiserror-impl v1.0.39                                                                                                   │
│    Compiling futures-macro v0.3.26                                                                                                    │
│    Compiling wezterm-dynamic-derive v0.1.0 (/Users/waleed/Workspace/wezterm/wezterm-dynamic/derive)                                   │
│    Compiling bytemuck_derive v1.4.0                                                                                                   │
│    Compiling phf_macros v0.11.1                                                                                                       │
│    Compiling pin-project-internal v1.0.12                                                                                             │
│     Checking tiff v0.8.1                                                                                                              │
│    Compiling signal-hook v0.3.15                                                                                                      │
│     Checking deltae v0.3.0                                                                                                            │
│     Checking scoped_threadpool v0.1.9                                                                                                 │
│     Checking atomic-waker v1.1.0                                                                                                      │
│     Checking blocking v1.3.0                                                                                                          │
│     Checking bytemuck v1.13.1                                                                                                         │
│     Checking phf v0.11.1                                                                                                              │
│    Compiling idna v0.3.0                                                                                                              │
│     Checking csscolorparser v0.6.2                                                                                                    │
│     Checking pin-project v1.0.12                                                                                                      │
│     Checking filedescriptor v0.8.2 (/Users/waleed/Workspace/wezterm/filedescriptor)                                                   │
│    Compiling pest v2.5.6                                                                                                              │
│     Checking flume v0.10.14                                                                                                           │
│     Checking sha2 v0.9.9                                                                                                              │
│     Checking exr v1.5.3                                                                                                               │
│     Checking vtparse v0.6.2 (/Users/waleed/Workspace/wezterm/vtparse)                                                                 │
│    Compiling num-derive v0.3.3                                                                                                        │
│     Checking phf v0.10.1                                                                                                              │
│     Checking nix v0.24.3                                                                                                              │
│     Checking signal-hook v0.1.17                                                                                                      │
│     Checking termios v0.3.3                                                                                                           │
│     Checking serial-core v0.4.0                                                                                                       │
│     Checking ioctl-rs v0.1.6                                                                                                          │
│     Checking termios v0.2.2                                                                                                           │
│    Compiling async-net v1.7.0                                                                                                         │
│     Checking semver-parser v0.10.2                                                                                                    │
│    Compiling async-process v1.6.0                                                                                                     │
│    Compiling pest_meta v2.5.6                                                                                                         │
│    Compiling async-fs v1.6.0                                                                                                          │
│     Checking semver v0.11.0                                                                                                           │
│     Checking memmem v0.1.1                                                                                                            │
│     Checking unicode-segmentation v1.10.1                                                                                             │
│     Checking finl_unicode v1.2.0                                                                                                      │
│     Checking fixedbitset v0.4.2                                                                                                       │
│     Checking hex v0.4.3                                                                                                               │
│     Checking same-file v1.0.6                                                                                                         │
│     Checking walkdir v2.3.2                                                                                                           │
│     Checking serial-unix v0.4.0                                                                                                       │
│    Compiling pest_generator v2.5.6                                                                                                    │
│     Checking url v2.3.1                                                                                                               │
│     Checking image v0.24.5                                                                                                            │
│     Checking async-executor v1.5.0                                                                                                    │
│     Checking bstr v0.2.17                                                                                                             │
│    Compiling miniz_oxide v0.4.4                                                                                                       │
│     Checking serial v0.4.0                                                                                                            │
│     Checking nix v0.25.1                                                                                                              │
│     Checking euclid v0.22.7                                                                                                           │
│     Checking dirs-sys-next v0.1.2                                                                                                     │
│     Checking filetime v0.2.20                                                                                                         │
│     Checking winnow v0.3.4                                                                                                            │
│     Checking downcast-rs v1.2.0                                                                                                       │
│     Checking shell-words v1.1.0                                                                                                       │
│     Checking dirs-next v2.0.0                                                                                                         │
│     Checking smol v1.3.0                                                                                                              │
│     Checking lru v0.7.8                                                                                                               │
│     Checking fsevent-sys v4.1.0                                                                                                       │
│     Checking match_cfg v0.1.0                                                                                                         │
│    Compiling pest_derive v2.5.6                                                                                                       │
│     Checking promise v0.2.0 (/Users/waleed/Workspace/wezterm/promise)                                                                 │
│     Checking hostname v0.3.1                                                                                                          │
│     Checking notify v5.1.0                                                                                                            │
│     Checking colorgrad v0.6.2                                                                                                         │
│    Compiling enum-display-derive v0.1.1                                                                                               │
│    Compiling wezterm-config-derive v0.1.0 (/Users/waleed/Workspace/wezterm/config/derive)                                             │
│     Checking umask v0.1.0 (/Users/waleed/Workspace/wezterm/umask)                                                                     │
│     Checking shlex v1.1.0                                                                                                             │
│    Compiling openssl-src v300.0.12+3.0.8                                                                                              │
│     Checking foreign-types-shared v0.1.1                                                                                              │
│     Checking itoa v1.0.6                                                                                                              │
│     Checking foreign-types v0.3.2                                                                                                     │
│    Compiling io-lifetimes v1.0.5                                                                                                      │
│    Compiling rustix v0.36.9                                                                                                           │
│     Checking errno v0.2.8                                                                                                             │
│    Compiling openssl-sys v0.9.71                                                                                                      │
│     Checking ordered-float v3.4.0                                                                                                     │
│     Checking toml_datetime v0.6.1                                                                                                     │
│     Checking serde_spanned v0.6.1                                                                                                     │
│    Compiling objc_exception v0.1.2                                                                                                    │
│     Checking wezterm-dynamic v0.1.0 (/Users/waleed/Workspace/wezterm/wezterm-dynamic)                                                 │
│     Checking toml_edit v0.19.4                                                                                                        │
│     Checking portable-pty v0.8.0 (/Users/waleed/Workspace/wezterm/pty)                                                                │
│ error[E0412]: cannot find type `RawFd` in `std::os::fd`                                                                               │
│    --> pty/src/unix.rs:326:48                                                                                                         │
│     |                                                                                                                                 │
│ 326 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {                                                                         │
│     |                                                ^^^^^ not found in `std::os::fd`                                                 │
│     |                                                                                                                                 │
│ help: consider importing this type alias                                                                                              │
│     |                                                                                                                                 │
│ 3   | use std::os::unix::prelude::RawFd;                                                                                              │
│     |                                                                                                                                 │
│ help: if you import `RawFd`, refer to it directly                                                                                     │
│     |                                                                                                                                 │
│ 326 -     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {                                                                         │
│ 326 +     fn as_raw_fd(&self) -> Option<RawFd> {                                                                                      │
│     |                                                                                                                                 │
│                                                                                                                                       │
│ error[E0412]: cannot find type `RawFd` in `std::os::fd`                                                                               │
│    --> pty/src/serial.rs:245:48                                                                                                       │
│     |                                                                                                                                 │
│ 245 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {                                                                         │
│     |                                                ^^^^^ not found in `std::os::fd`                                                 │
│     |                                                                                                                                 │
│ help: consider importing this type alias                                                                                              │
│     |                                                                                                                                 │
│ 8   | use std::os::unix::prelude::RawFd;                                                                                              │
│     |                                                                                                                                 │
│ help: if you import `RawFd`, refer to it directly                                                                                     │
│     |                                                                                                                                 │
│ 245 -     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {                                                                         │
│ 245 +     fn as_raw_fd(&self) -> Option<RawFd> {                                                                                      │
│     |                                                                                                                                 │
│                                                                                                                                       │
│ error[E0412]: cannot find type `RawFd` in `std::os::fd`                                                                               │
│    --> pty/src/lib.rs:114:48                                                                                                          │
│     |                                                                                                                                 │
│ 114 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd>;                                                                          │
│     |                                                ^^^^^ not found in `std::os::fd`                                                 │
│     |                                                                                                                                 │
│ help: consider importing this type alias                                                                                              │
│     |                                                                                                                                 │
│ 40  | use std::os::unix::prelude::RawFd;                                                                                              │
│     |                                                                                                                                 │
│ help: if you import `RawFd`, refer to it directly                                                                                     │
│     |                                                                                                                                 │
│ 114 -     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd>;                                                                          │
│ 114 +     fn as_raw_fd(&self) -> Option<RawFd>;                                                                                       │
│     |                                                                                                                                 │
│                                                                                                                                       │
│ error[E0603]: module `fd` is private                                                                                                  │
│    --> pty/src/unix.rs:326:44                                                                                                         │
│     |                                                                                                                                 │
│ 326 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {                                                                         │
│     |                                            ^^ private module                                                                    │
│     |                                                                                                                                 │
│ note: the module `fd` is defined here                                                                                                 │
│                                                                                                                                       │
│ error[E0603]: module `fd` is private                                                                                                  │
│    --> pty/src/serial.rs:245:44                                                                                                       │
│     |                                                                                                                                 │
│ 245 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {                                                                         │
│     |                                            ^^ private module                                                                    │
│     |                                                                                                                                 │
│ note: the module `fd` is defined here                                                                                                 │
│                                                                                                                                       │
│ error[E0603]: module `fd` is private                                                                                                  │
│    --> pty/src/lib.rs:114:44                                                                                                          │
│     |                                                                                                                                 │
│ 114 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd>;                                                                          │
│     |                                            ^^ private module                                                                    │
│     |                                                                                                                                 │
│ note: the module `fd` is defined here                                                                                                 │
│                                                                                                                                       │
│     Checking wezterm-color-types v0.2.0 (/Users/waleed/Workspace/wezterm/color-types)                                                 │
│     Checking wezterm-bidi v0.2.2 (/Users/waleed/Workspace/wezterm/bidi)                                                               │
│ Some errors have detailed explanations: E0412, E0603.                                                                                 │
│ For more information about an error, try `rustc --explain E0412`.                                                                     │
│ error: could not compile `portable-pty` due to 6 previous errors                                                                      │
│ warning: build failed, waiting for other jobs to finish...                                                                            │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
   Finished The MSRV is: 1.66.1   ██████████████████████████████████████████████████████████████████████████████████████████████ 00:05:30
```

However, the issue is simple to work around: just don't use the symbol `std::os::fd::RawFd` directly. This commit:

1) changes the interface to use a new exported symbol `RawFd` from the `crate::unix` module;
2) imports `std::os::unix::io::RawFd` instead of `std::os::fd::RawFd` as the symbol exported from `crate::unix`.

Doing so fixes the build in earlier versions of Rust:

```
$ cargo +1.63.0 check -p portable-pty --all-targets
    Checking portable-pty v0.8.0 (/Users/waleed/Workspace/wezterm/pty)
error[E0412]: cannot find type `RawFd` in `std::os::fd`
   --> pty/src/unix.rs:326:48
    |
326 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {
    |                                                ^^^^^ not found in `std::os::fd`
    |
help: consider importing this type alias
    |
3   | use std::os::unix::prelude::RawFd;
    |
help: if you import `RawFd`, refer to it directly
    |
326 -     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {
326 +     fn as_raw_fd(&self) -> Option<RawFd> {
    |

error[E0412]: cannot find type `RawFd` in `std::os::fd`
   --> pty/src/serial.rs:245:48
    |
245 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {
    |                                                ^^^^^ not found in `std::os::fd`
    |
help: consider importing this type alias
    |
8   | use std::os::unix::prelude::RawFd;
    |
help: if you import `RawFd`, refer to it directly
    |
245 -     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {
245 +     fn as_raw_fd(&self) -> Option<RawFd> {
    |

error[E0412]: cannot find type `RawFd` in `std::os::fd`
   --> pty/src/lib.rs:114:48
    |
114 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd>;
    |                                                ^^^^^ not found in `std::os::fd`
    |
help: consider importing this type alias
    |
40  | use std::os::unix::prelude::RawFd;
    |
help: if you import `RawFd`, refer to it directly
    |
114 -     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd>;
114 +     fn as_raw_fd(&self) -> Option<RawFd>;
    |

error[E0603]: module `fd` is private
   --> pty/src/unix.rs:326:44
    |
326 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {
    |                                            ^^ private module
    |
note: the module `fd` is defined here

error[E0603]: module `fd` is private
   --> pty/src/serial.rs:245:44
    |
245 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd> {
    |                                            ^^ private module
    |
note: the module `fd` is defined here

error[E0603]: module `fd` is private
   --> pty/src/lib.rs:114:44
    |
114 |     fn as_raw_fd(&self) -> Option<std::os::fd::RawFd>;
    |                                            ^^ private module
    |
note: the module `fd` is defined here

Some errors have detailed explanations: E0412, E0603.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `portable-pty` due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `portable-pty` due to 6 previous errors

$ cargo +1.63.0 check -p portable-pty --all-targets
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
```
2023-03-12 20:48:01 -07:00
Wez Furlong
4b2973a9d4
deps: open -> 4.0 2023-03-12 20:37:58 -07:00
Wez Furlong
0d231f6fe4
cargo update 2023-03-12 20:22:05 -07:00
Wez Furlong
55982436d9
cargo update 2023-03-05 22:18:33 -07:00
Wez Furlong
2d05f8f1f2
ssh: support %l and %L in config files
We also log a warning when an unsupported token is used.

refs: https://github.com/wez/wezterm/issues/3176
2023-03-01 18:44:11 -07:00
Wez Furlong
0ac1cbc47c
deps: socket2 -> 0.5 2023-02-26 22:33:28 -07:00
Wez Furlong
6878ec3a92
cargo update 2023-02-26 22:32:52 -07:00
Wez Furlong
70f255bce8
cargo update 2023-02-17 11:30:15 -07:00
Wez Furlong
3509e210ce
termwiz: bump version ready for publish 2023-02-12 06:57:31 -07:00
Wez Furlong
0006014f02
ssh: detect exit-signal state for channels
Need to use a newer version of libssh-rs that can report this state,
as the underlying libssh doesn't fold it into the process exit
status.

refs: https://github.com/wez/wezterm/issues/3095
2023-02-11 10:03:44 -07:00
Wez Furlong
62dc342128
cargo update 2023-02-08 21:25:41 -07:00
Wez Furlong
fd5c6dceb1
window: use a shorter timeout for xdg portal reads
A user reported this:

08:47:13.372  DEBUG  window::os::x11::connection        > Unable to
   resolve appearance using xdg-desktop-portal: Read:
   org.freedesktop.DBus.Error.TimedOut: Failed to activate service
   'org.freedesktop.portal.Desktop': timed out
   (service_start_timeout=120000ms)

which is an issue with their xdg-portal service.

Rather than have wezterm block for 2 minutes on startup, we give it
1 second, and log the issue as a warning.
2023-02-08 09:19:28 -07:00
Wez Furlong
74dc74b7c8
deps: wgpu -> 0.15
This might help with https://github.com/wez/wezterm/issues/3032
2023-02-06 07:19:31 -07:00
Wez Furlong
16d75c972b
cargo update 2023-02-05 21:53:11 -07:00
Wez Furlong
1609fd386b
add wezterm cli get-text command
closes: https://github.com/wez/wezterm/pull/2729
2023-02-05 09:05:48 -07:00