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
* 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>
* 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>
* 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>
* 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
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'
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
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
* 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.
* 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
* 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
* 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.
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
* 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>
* 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>
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.
* 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
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
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
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
* 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>