mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-19 11:31:19 +00:00
config: grapheme-width-method sets mode 2027
Fixes #1403 This changes the behavior of `grapheme-width-method = unicode` to change the default state of mode 2027 to true. Prior to this, setting this config would force grapheme clustering regardless of mode 2027. Now, this only sets the default and running TUI programs can disable it if they want.
This commit is contained in:
@@ -135,7 +135,13 @@ pub fn init(alloc: Allocator, opts: termio.Options) !Exec {
|
||||
errdefer term.deinit(alloc);
|
||||
term.default_palette = opts.config.palette;
|
||||
term.color_palette.colors = opts.config.palette;
|
||||
term.flags.default_grapheme_cluster = opts.config.grapheme_width_method == .unicode;
|
||||
|
||||
// Setup our initial grapheme cluster support if enabled. We use a
|
||||
// switch to ensure we get a compiler error if more cases are added.
|
||||
switch (opts.config.grapheme_width_method) {
|
||||
.unicode => term.modes.set(.grapheme_cluster, true),
|
||||
.wcswidth => {},
|
||||
}
|
||||
|
||||
// Set the image size limits
|
||||
try term.screen.kitty_images.setLimit(alloc, opts.config.image_storage_limit);
|
||||
@@ -373,8 +379,6 @@ pub fn changeConfig(self: *Exec, config: *DerivedConfig) !void {
|
||||
// - command, working-directory: we never restart the underlying
|
||||
// process so we don't care or need to know about these.
|
||||
|
||||
self.terminal.flags.default_grapheme_cluster = config.grapheme_width_method == .unicode;
|
||||
|
||||
// Update the default palette. Note this will only apply to new colors drawn
|
||||
// since we decode all palette colors to RGB on usage.
|
||||
self.terminal.default_palette = config.palette;
|
||||
|
||||
Reference in New Issue
Block a user