Commit Graph
1405 Commits
Author SHA1 Message Date
mgpinf 7053748e4d refactor: remove redundant character checks in Launcher, InputSelector
We don't need to check if the alphabet includes 'j', 'k' because if a
character is included in the alphabet, the code corresponding to the
first arm is executed
2025-03-17 06:29:59 -07:00
Wez Furlong 46cfda6665 shapecache: fixup for noto font update 2025-03-09 07:37:51 -07:00
Wez Furlong 5c6db3d9be unicode_names: update for unicode 16 2025-03-09 05:51:00 -07:00
mgpinfandWez Furlong 413ebd5681 Add configuration option for InputSelector label background and foreground color (#6682)
* feat: add configuration option for InputSelector label bg and fg

Add below configuration option in config.colors:
- input_selector_label_bg
- input_selector_label_fg

If above mentioned options are not set in the configuration file then:
- input_selector_label_bg defaults to default background color
- input_selector_label_fg defaults to default foreground color

* docs: add InputSelector label bg, fg options to Colors & Appearance

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-03-09 04:29:13 -07:00
mgpinfandWez Furlong 46f74a5bf7 Add alphabet to launcher args (#6677)
* feat: add alphabet argument to ShowLauncherArgs

- The labels are now based on the provided argument or the default value
- The 'alphabet' string defaults to "1234567890abcdefghilmnopqrstuvwxyz"
- Optional argument 'alphabet' is added to 'ShowLauncherArgs'

* docs: update documentation for ShowLauncherArgs

* fix: push (max_label_len+3) whitespaces if always_fuzzy false in InputSelector

This is to handle the edge case in InputSelector when max_label_len is 2
and the labels shift one place to the left when entering fuzzy mode and
back one place to the right when exiting fuzzy mode.

* fix: push (max_label_len+3) whitespaces if 'FUZZY' not present

This is to handle the edge case in Launcher when max_label_len is 2
and the labels shift one place to the left when entering fuzzy mode and
back one place to the right when exiting fuzzy mode.

* feat: add configuration option for Launcher alphabet

- This is in order to be able to configure the alphabet for
  actions corresponding to KeyAssignment enums 'ShowLauncher',
  'ShowTabNavigator'
- If `launcher_alphabet` configuration option not set, the value
  defaults to '1234567890abcdefghilmnopqrstuvwxyz'

* docs: add launcher_alphabet documentation

* docs: update documentation for ShowLauncherArgs

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-03-08 10:22:11 -07:00
mgpinfandWez Furlong 2dda592ba6 Add Confirmation to Key assignment (#6707)
* feat: add Confirmation to KeyAssignment

This displays a confirmation menu similar to close menu.
An optional cancellation action that is triggered when the user
cancels/declines.

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-03-08 10:18:40 -07:00
mgpinf 8ae3d27b09 feat: display quick select label and match in bold 2025-03-08 05:11:07 -08:00
mgpinf 85409e57a3 Option to disable attributes for non matching text in quick select mode (#6683)
* feat: optionally disable non-matching text attributes in Quick Select

Add a configuration option
'disable_attributes_for_non_matching_text_in_quick_select' that disables
all attributes for non-matching text in Quick Select Mode.
The default value for
'disable_attributes_for_non_matching_text_in_quick_select' is false

This resolves the issue https://github.com/wezterm/wezterm/issues/4022

* docs: documentation for disabling attributes for non matching text in QuickSelect

Add documentation for the below configuration option:
- `disable_attributes_for_non_matching_text_in_quick_select`

* feat: display quick select label and match in bold

* refactor: fetch colors from existing reference to config

* fix: reset additional attributes for non matching text

Reset additional below mentioned attributes to default for non matching
text if the configuration option
disable-attributes-for-non-matching-text-in-quick-select-mode is true
- Italic
- Blink
- StrikeThrough
- Invisible
- Hyperlink

* fix: update attributes to reset

* feat: add reset_attributes function in termwiz cell

Add reset_attributes function in termwiz cell
Use the above function to reset cell attributes for the cell

* refactor: update method name to clear_attributes

* termwiz: update version because public method has been added

Update termwiz version because a new method 'reset_attributes' has been
added in termwiz/src/cell.rs

* fix: update get_lines method in quickselect to be same as with_lines_mut

* termwiz: simpler method name, implementation to clear cell attributes

Use simpler method name and implementation as per suggestion
https://github.com/wezterm/wezterm/pull/6683#discussion_r1966596988

* refactor: clear cell attributes for every line if flag is set

Clear attributes for every line if the configuration option
disable-attributes-for-non-matching-text-in-quick-select has been set
Partially implement changes mentioned in suggestion
https://github.com/wezterm/wezterm/pull/6683#discussion_r1966597826

* refactor: replace for loop with for_each method to iterate through cells

Partially implement changes mentioned in suggestion
https://github.com/wezterm/wezterm/pull/6683#discussion_r1966597826

* refactor: rename configuration option to quick_select_remove_styling

Rename option to remove styling in quick select from
'disable_attributes_for_non_matching_text_in_quick_select' to
'quick_select_remove_styling'
Implement changes mentioned in suggestion
https://github.com/wezterm/wezterm/pull/6683#discussion_r1966598496

* fix: remove bold attribute when displaying quick select label, match

This is in order to raise this in a separate PR

Suggestion mentioned here
https://github.com/wezterm/wezterm/pull/6683#issuecomment-2676394535

* docs: update documentation for quick_select_remove_styling

* termwiz: just bump minor part

Since the only change in termwiz is addition of a public method, it
should be forward compatible, so we can just bump the minor part

Apply changes mentioned in suggestion
https://github.com/wezterm/wezterm/pull/6683#discussion_r1966600258

* fix: clear attributes for each cell in all lines in get_lines method

Apply changes mentioned in suggestion
https://github.com/wezterm/wezterm/pull/6683#discussion_r1966848308

* fix: clear appdata for line after clearing attributes of each cell

Move call to clear appdata for line after the call to clear attributes
from each cell when configuration option 'quick_select_remove_styling'
is enabled
Apply changes mentioned in suggestion
https://github.com/wezterm/wezterm/pull/6683#discussion_r1966848015
2025-02-23 15:37:09 -07:00
DevHegemony f7db9554f5 shift check bit when comparing to pattern 2025-02-22 13:20:52 -08:00
Wez Furlong 3b994de290 deps: remove once_cell in favor of std functionality 2025-02-12 10:00:31 -07:00
Wez Furlong 23789c971c deps: update wgpu from 22.1 -> 24.0.1
There's a long list of fixes and changes with these two major
version bumps.
2025-02-11 18:35:20 -07:00
Benoit de Chezelles e275712d76 glyph: Fix glyph '┽', was rendering as '┥' 2025-02-11 13:19:31 -07:00
Wez Furlong 52c1ca7495 tabbar: show progress in tab by default
refs: https://github.com/wezterm/wezterm/issues/6581
2025-02-10 11:53:12 -07:00
mgpinf 3bc67e4467 fix: reset attributes to default before emitting CRLF in Launcher Menu
For most cases we don't require this, but since launch_menu items are
configurable and it contains a list of SpawnCommand objects, and
SpawnCommand has a an optional field to show in the launcher called
'label', this change handles cases where user passes a value formatted
using wezterm.format against 'label'
2025-02-10 07:08:46 -07:00
mgpinf dd0198df67 fix: emit CRLF after attributes have reversed
Moving to the next line before the attributes are reversed might lead to
some wonky behavior in some edge cases. So to be on the safe side, emit
CRLF after attributes have been reversed
2025-02-10 07:08:46 -07:00
Wez Furlong 44866cc137 new: ConEmu progress reporting OSC sequence
This commit parses and captures the progress state as set by
ConEmu style progress reporting escape sequences.

Changes to the state will propagage through the mux via the
existing MuxNotification Alert system, and should also transit
across multiplexer connections.  However, there is no separate
multiplexer state transfer for the progress state, so reconnecting
to a mux in the middle of a progress sequence will show as None
for the progress state, until the next update occurs.

Aside from propgating and exposing the state to lua via PaneInformation
and a Pane::get_progress method, wezterm doesn't do anything with
the progress information at this time.

This commit includes an example of how you might customize your
tab title to reflect the progress in the active pane.

refs: https://github.com/wezterm/wezterm/issues/6581
2025-02-09 18:26:23 -07:00
Wez Furlong 0eed1166a3 docs: changelog for #6606 2025-02-09 13:08:35 -07:00
mgpinf 4c32d6fd50 Add help_text and fuzzy_help_text arguments to ShowLauncherArgs (#6606)
* feat: add help_text, fuzzy_help_text arguments in ShowLauncherArgs

Add help_text, fuzzy_help_text optional arguments in ShowLauncherArgs.
Similar to description, fuzzy_description arguments present in
InputSelector.
If help_text argument is not provided, default value of `"Select an item
and press Enter=launch Esc=cancel  /=filter"` is displayed
If fuzzy_help_text argument is not provided, default value of `"Fuzzy
matching: "` is displayed

* docs: update documentation for ShowLauncherArgs

* perf: pass LauncherActionArgs struct rather than reference

Since fields are being cloned in the callee function, pass the struct
rather than reference to it.
2025-02-09 13:05:54 -07:00
mgpinf ef689c5eee fix: display whitespace before reset of attributes in InputSelector (#6609)
* fix: display whitespace before reset of attributes in InputSelector

Display white space before reset of background and setting attributes to
default in InputSelector. This is in order for whitespace after the
option to be highlighted in the same background color as the currently
selected option.
The above mentioned points are currently reflected in ShowLauncherArgs
but not in InputSelector.

* fix: emit CRLF after attributes have changed

Moving to the next line before the others are applied might lead to some
wonky behavior in some edge cases. So to be on the safe side, emit CRLF
after attributes have changed
2025-02-09 09:54:21 -07:00
nhurlockandWez Furlong b374d383ce QuickSelectArgs: optionally bypass custom action on paste (#6405)
* QuickSelectArgs: optionally bypass performing action on paste

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-02-08 19:38:40 -07:00
Shiphan 94a4252f28 Add config option to adjust window alignment 2025-02-08 15:34:15 -07:00
mgpinf f55293262e Select active tab choice as initial choice in ShowTabNavigator (#6320)
* Select current tab option as initial choice in ShowTabNavigator

This introduces the following changes
- Select the choice corresponding to the active tab as the initial choice

* docs: Add current tab choice documentation in ShowTabNavigator

This changes the following
- Update ShowTabNavigator.md with current tab choice documentation

* refactor: remove redundant local variable
2025-02-08 14:43:34 -07:00
MikkaandWez Furlong 6e2eeed6e5 fix: opening the InputSelector resulted in invalid pane ids (#6403)
* fix: opening the InputSelector resulted in invalid pane ids

* Update wezterm-gui/src/termwindow/mod.rs

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-02-08 14:08:31 -07:00
Erik Schnetter 94610314e8 Support Unicode 16 octant characters (#6502)
* Support Unicode 16 octant characters

* Add missing Unicode 16 block characters

* Simplify sextant/octant implementation

* Add missing octant, correct indexing error

* Correct sextant/octant lookups
2025-02-08 13:43:33 -07:00
saltkid 3a6c7a8c83 fix: setting width and height to Contain is not preserving aspect ratio of tall images (#6554)
* fix: `Contain` not preserving aspect ratio of tall images

When both width and height is set to `Contain`, the scaling uses the
wrong direct proportional scaling formula for tall images. This is due
to `aspect` being `width / height`:
By dividing (original), the formula expands to `scaled_width /
scaled_height : height / width` which inversely scaled the width of tall
images. By multiplying instead, the formula correctly expands to
`scaled_width / scaled_height : width / height` which preserves aspect
ratio when scaling.

* refactor: simplify "Contain" and "Cover" formulas; use max for "Cover", min for "Contain"

This was derived from the principle of direct proportion `x=ky` where
`k` is the scaling factor, and `x` `y` are the dimensions. Scaling
factor is based on image's dimension relative to the window's.

Contain needs the minimum scaling factor to ensure both dimensions fit
within the window. Cover needs maximum scaling factor to ensure the
image's smaller dimension fits in the window, allowing the larger
dimension to crop, as expected.
2025-02-08 13:18:12 -07:00
Wez Furlong b6ec0b03d6 macos: suppress warnings from legacy objc crate
This is a PITA. The objc crate does some stuff that spews warnings
everywhere that the sel! and msg_send! macros are used.

That crate is not currently maintained

There is a fork of the crate which resolves the spew, but we also
use the cocoa crate which pulls in the original crate

The new fork is not compatible with cargo workspace patching.

There is an alternative objc2 crate with a nicer, more type-safe
API, but the API changes to migrate are pretty huge: I just lost
a couple of hours on this and still hadn't gotten past the migrating
the NSMenu stuff over.

So, the approach here is to simply ignore the warnings in the modules
that use the objc crate.

This will need to be fixed by someone someday, but that day is not
today.

refs: https://github.com/SSheldon/rust-objc/issues/125
2025-02-07 22:23:22 -07:00
Wez Furlong 16bf08feb0 rustfmt 2025-02-07 19:27:06 -07:00
Wez Furlong 11c4b11669 s,wez/wezterm,wezterm/wezterm,
I moved the repo to an org of its own. Update various things
to reference the new location.
2025-02-07 13:08:01 -07:00
Wez Furlong 5c5d2c8a62 rustfmt 2025-02-06 21:24:58 -07:00
Wez Furlong 00644d4e1a update for new wezterm.org domain 2025-02-06 21:13:50 -07:00
Wez Furlong 67603e73e0 PromptInputLine: fixup per code review
Apply my suggestions from code review.

closes: https://github.com/wez/wezterm/pull/6007
2024-09-22 14:45:11 -07:00
Eduard Korchmar b59cc5b008 feat: add a way to spawn populated LineEditor
feat: support pre-filled content in prompts

docs: document new PromptInputLine parameter

fix: remove reset of line contents
2024-09-22 14:45:11 -07:00
mgpinfandWez Furlong 6a12dd1a13 Custom prompt for PromptInputLine (#6054)
* option to configure PromptInputLine prompt

- Introduces an option to set custom prompt text
- If 'prompt' not passed in parameters, default value of "> " used

* commit: update documentation for PromptInputLine

* Update docs/config/lua/keyassignment/PromptInputLine.md

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2024-09-22 10:55:55 -07:00
Wez Furlong 09ac8c5377 wgpu -> 22.1
Tested on X11 and Wayland via weston and seems to work

closes: https://github.com/wez/wezterm/pull/5814
2024-09-15 05:56:56 -07:00
SeanandSean Estabrooks e5387997ba Restrict bell events to the proper window. (#6012)
* Restrict bell events to the proper window.

As per the comment in mod.rs, bell events are sent to
all windows; not just the window containing the pane
which generated the event.

To prevent each bell ringing multiple times, the window
event handler must check if it has the pane, and ignore
the bell event if it doesn't.

This fixes bug #5985

Co-authored-by: Sean Estabrooks <sean.estabrooks@eztux.com>
2024-09-14 08:25:44 -07:00
Wez Furlong c0649ad4bb remove cfg_attr(feature = "cargo-clippy" noise
I never liked clippy for dropping turds like this throughout the
code. I'm glad it is no longer required, but now rust is warning
about this syntax being redundant.
2024-09-14 06:49:13 -07:00
Wez Furlong 56a27e93a9 cargo update
plus some noise around the image crate api evolving and deprecating
some type aliases.
2024-07-30 08:27:27 -07:00
Leszek Swirski fef52df952 Add a CloseWithoutClear copy mode key assignment (#4924)
* Add a CloseWithoutClear copy mode key assignment

Closing the copy overlay currently unconditionally clears the viewport,
in particular resetting scroll. For the search overlay, we don't
necessarily want to scroll back to the prompt after finding a match --
indeed, the old search overlay (which didn't use copy mode) had this
behaviour.

Add a CloseWithoutClear key assignment which has this desired behaviour,
and make it the default for ESC in search mode.

* Change CloseWithoutClear into normal Close, and add ResetViewport

* Remove ResetViewport, add helper for keys
2024-07-22 08:06:54 -07:00
Wez Furlong b20c61926e switch all fuzzy matches to nucleo
Centralize the thread local state management into the selector module
to make it a bit more convenient to consume from the various other
locations.

closes: https://github.com/wez/wezterm/issues/5532
2024-07-14 11:03:54 -07:00
Wez Furlong 6b5edad360 charselect: switch to nucleo fuzzy matcher
This has more intuitive sorting; eg: `line` used to show the first match
as `linux_endeavour` but now matches `LINEAR B IDEOGRAM VESSEL B212`
first, which feels more relevant (has an exact prefix match).

refs: https://github.com/wez/wezterm/issues/5532
2024-07-14 10:41:26 -07:00
Wez Furlong 824def9e2c remove some unused fields 2024-07-14 07:59:25 -07:00
Wez Furlong 616eb2fc21 fix: PaneInformation.pixel_height returned width!
Thank you to Rust's unread field warning!
2024-07-14 07:52:05 -07:00
Wez Furlong 209d13bd6b allow some unused fields
I want these for the future, and they are harmless now
2024-07-14 07:50:30 -07:00
Wez Furlong f7a0a0f1a6 blob-lease: improve error handling
If someone removed the directory structure, or otherwise messed with
the files, there was a good chance that we'd end up in a panic.

This commit improves the error messaging produced by the blob
lease layer to provide the path as context, log the error,
and then translate the error case to an empty frame so that
the rest of the rendering machinery can proceed in a more reasonable
way.

We take care to log this sort of corrupt frame error only once,
as it is most likely to occur in an animated gif and will thus
trigger multiple times per second for such a file.

refs: #5422
2024-07-14 07:45:10 -07:00
Wez Furlong ff4528e783 fix: blob leases could be broken by tmpwatch
Let's put them in an application-specific cache directory
location instead.

refs: #5422
2024-07-14 07:10:17 -07:00
Wez Furlong 4e8eb7c2ca fix: quickselect now matches paths with //
closes: https://github.com/wez/wezterm/issues/5763
2024-07-13 14:25:01 -07:00
Aleksey Kuznetsov a46bad17d2 config: show/hide close-tab button 2024-07-13 11:32:54 -07:00
Ken ChouandWez Furlong 1533409ed7 Feature: The search overlay accepts IME composed input (#5564)
* Feature: The search overlay accepts IME composed input
* use LineEditBuffer

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2024-06-15 05:42:00 -07:00
Ivan MoiseevandKen Chou 72465af6d7 Add arrows support for search field (#5416)
* feat: add arrows support for search field
* refactor: extract LineEditBuffer from LineEditor
* refactor: migrate search field to LineEditBuffer
* feat: add key bindings for search field

Co-authored-by: Ken Chou <kenchou77@gmail.com>
2024-06-14 11:21:07 -07:00
Wez Furlong 6c890c3995 update metrics to latest version (0.22) 2024-05-13 09:41:12 -07:00