wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
16.78k stars 751 forks source link

First line is getting overwritten in wezterm #4585

Closed aamir-sultan closed 10 months ago

aamir-sultan commented 10 months ago

What Operating System(s) are you seeing this problem on?

Windows

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20230712-072601-f4abf8fd

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

No, and I'll explain why below

Describe the bug

I am having issues with wezterm with the first line replacement. One can take a look in the video. I am not sure why this is happening. I am using a WSL on windows. I have tried other WSLs (Ubuntu, CentOS7 and AlmaLinux) but the issue persists which means it is WSL agnostic. I have also done a reset to windows and after fresh start installed wezterm the issue is still there. I have tried the nightly builds the issue is persistent. I am not sure if the issue is with wezterm or I am missing something. As for as the configuration(.wezterm.lua) is concerened, I have tried with and without the configuration but issue seems to have nothing to do with the configuration. Any ideas to resolve the issue? Should it be filed on github or am I missing something. I am out of ideas. It is getting very annoying to work. When I do ctrl+l which is command to clean the screen the command appears sometimes, not shown in this video, I tried but the command didn't refreshed this time. Sorry for the command, I am trying to type fast to keep the video short.

Thanks in advance.

https://github.com/wez/wezterm/assets/73219885/4218a435-852f-4ed0-862b-843c25385a66

To Reproduce

Configuration

-- Pull in the wezterm API local wezterm = require 'wezterm' local gpus = wezterm.gui.enumerate_gpus()

-- This table will hold the configuration. local config = {}

-- In newer versions of wezterm, use the config_builder which will -- help provide clearer error messages if wezterm.config_builder then config = wezterm.config_builder() end


--- functions

-- selene: allow(unused_variable) ---@diagnostic disable-next-line: unused-function, unused-local local function enable_wayland() local session = os.getenv("DESKTOP_SESSION") if session == "hyprland" then return true end -- local wayland = os.getenv("XDG_SESSION_TYPE") -- if wayland == "wayland" then -- return true -- end return false end

-- This is where you actually apply your config choices

-- For example, changing the color scheme: -- config.color_scheme = 'AdventureTime' -- config.color_scheme = 'Ayu Dark' -- config.color_scheme = 'ayu' config.color_scheme = 'Batman' config.font = wezterm.font_with_fallback { { family = 'JetBrains Mono', weight = 'Medium', style = 'Italic', harfbuzz_features = { 'calt=0', 'clig=0', 'liga=0' }, }, { family = 'Terminus', weight = 'Bold' }, 'Noto Color Emoji', }

-- Background Settings -- config.window_background_gradient = { -- -- Can be "Vertical" or "Horizontal". Specifies the direction -- -- in which the color gradient varies. The default is "Horizontal", -- -- with the gradient going from left-to-right. -- -- Linear and Radial gradients are also supported; see the other -- -- examples below -- orientation = 'Vertical',

-- -- Specifies the set of colors that are interpolated in the gradient. -- -- Accepts CSS style color specs, from named colors, through rgb -- -- strings and more -- colors = { -- '#0f0c29', -- '#302b63', -- '#24243e', -- },

-- -- Instead of specifying colors, you can use one of a number of -- -- predefined, preset gradients. -- -- A list of presets is shown in a section below. -- -- preset = "Warm",

-- -- Specifies the interpolation style to be used. -- -- "Linear", "Basis" and "CatmullRom" as supported. -- -- The default is "Linear". -- interpolation = 'Linear',

-- -- How the colors are blended in the gradient. -- -- "Rgb", "LinearRgb", "Hsv" and "Oklab" are supported. -- -- The default is "Rgb". -- blend = 'Rgb',

-- -- To avoid vertical color banding for horizontal gradients, the -- -- gradient position is randomly shifted by up to the noise value -- -- for each pixel. -- -- Smaller values, or 0, will make bands more prominent. -- -- The default value is 64 which gives decent looking results -- -- on a retina macbook pro display. -- -- noise = 64,

-- -- By default, the gradient smoothly transitions between the colors. -- -- You can adjust the sharpness by specifying the segment_size and -- -- segment_smoothness parameters. -- -- segment_size configures how many segments are present. -- -- segment_smoothness is how hard the edge is; 0.0 is a hard edge, -- -- 1.0 is a soft edge.

-- -- segment_size = 11, -- -- segment_smoothness = 0.0, -- }

config.window_background_image = 'D://Mega//backgrounds//2184.jpg' config.window_background_opacity = .99 config.text_background_opacity = 0.3 config.window_background_image_hsb = { -- Darken the background image by reducing it to 1/3rd brightness = 0.1,

-- You can adjust the hue by scaling its value.
-- a multiplier of 1.0 leaves the value unchanged.
hue = 1.0,

-- You can adjust the saturation also.
saturation = 1.0,

}

-- Additional Settings config.automatically_reload_config = true config.enable_scroll_bar = true config.disable_default_key_bindings = true config.check_for_updates = false config.use_ime = true config.ime_preedit_rendering = "Builtin" config.use_dead_keys = false config.warn_about_missing_glyphs = false -- config.enable_kitty_graphics = false config.animation_fps = 1 config.cursor_blink_ease_in = "Constant" config.cursor_blink_ease_out = "Constant" config.cursor_blink_rate = 0 config.enable_wayland = enable_wayland() -- https://github.com/wez/wezterm/issues/1772 -- config.enable_wayland = true -- config.color_scheme = "nordfox" -- config.color_scheme_dirs = { os.getenv("HOME") .. "/.config/wezterm/colors/" } config.hide_tab_bar_if_only_one_tab = false config.adjust_window_size_when_changing_font_size = false config.selection_word_boundary = " \t\n{}[]()\"'`,;:│=&!%" config.window_padding = { left = 0, right = 0, top = 0, bottom = 0, } config.use_fancy_tab_bar = false -- config.colors = { -- tab_bar = { -- background = scheme.background, -- new_tab = { bg_color = "#2e3440", fg_color = scheme.ansi[8], intensity = "Bold" }, -- new_tab_hover = { bg_color = scheme.ansi[1], fg_color = scheme.brights[8], intensity = "Bold" }, -- -- format-tab-title -- -- active_tab = { bg_color = "#121212", fg_color = "#FCE8C3" }, -- -- inactive_tab = { bg_color = scheme.background, fg_color = "#FCE8C3" }, -- -- inactive_tab_hover = { bg_color = scheme.ansi[1], fg_color = "#FCE8C3" }, -- }, -- } config.exit_behavior = "CloseOnCleanExit" config.tab_bar_at_bottom = false config.window_close_confirmation = "AlwaysPrompt" -- config.window_background_opacity = 0.8 config.disable_default_key_bindings = true -- config.visual_bell = { -- fade_in_function = "EaseIn", -- fade_in_duration_ms = 150, -- fade_out_function = "EaseOut", -- fade_out_duration_ms = 150, -- } -- config.separate config.enable_csi_u_key_encoding = true config.leader = { key = "Space", mods = "CTRL|SHIFT" } -- config.keys = keybinds.create_keybinds() -- config.key_tables = keybinds.key_tables -- config.mouse_bindings = keybinds.mouse_bindings -- https://github.com/wez/wezterm/issues/2756 config.webgpu_preferred_adapter = gpus[1] config.front_end = "OpenGL" -- config.max_fps = 60

-- for _, gpu in ipairs(wezterm.gui.enumerate_gpus()) do -- if gpu.backend == "Vulkan" and gpu.device_type == "IntegratedGpu" then -- config.webgpu_preferred_adapter = gpu -- config.front_end = "WebGpu" -- break -- end -- end

config.hyperlink_rules = { -- Matches: a URL in parens: (URL) { regex = '\((\w+://\S+)\)', format = '$1', highlight = 1, }, -- Matches: a URL in brackets: [URL] { regex = '\[(\w+://\S+)\]', format = '$1', highlight = 1, }, -- Matches: a URL in curly braces: {URL} { regex = '\{(\w+://\S+)\}', format = '$1', highlight = 1, }, -- Matches: a URL in angle brackets: { regex = '<(\w+://\S+)>', format = '$1', highlight = 1, }, -- Then handle URLs not wrapped in brackets { -- Before --regex = '\b\w+://\S+[)/a-zA-Z0-9-]+', --format = '$0', -- After regex = '[^(]\b(\w+://\S+[)/a-zA-Z0-9-]+)', format = '$1', highlight = 1, }, -- implicit mailto link { regex = '\b\w+@[\w-]+(\.[\w-]+)+\b', format = 'mailto:$0', }, } table.insert(config.hyperlink_rules, { regex = [[["]?([\w\d]{1}[-\w\d]+)(/){1}([-\w\d.]+)["]?]], format = "https://github.com/$1/$3", })

-- and finally, return the configuration to wezterm return config

Expected Behavior

Commands to be not overwritten and written correctly. Also when backspaced should be able to completely backspace it.

Logs

No response

Anything else?

When I try to backspace the command it can produce all kind of different results. Like removing half the line and after that not deleting anything from the line. Yes I have tried the nightly build by downloading from https://github.com/wez/wezterm/releases/download/nightly/WezTerm-nightly-setup.exe https://github.com/wez/wezterm/releases/download/nightly/WezTerm-windows-nightly.zip. But currently I am back to the stable version which is already mentioned above.

The issue persists. Please do let me know if anything is on my end and I can do to fix this.

uncomfyhalomacro commented 10 months ago

I feel like it's a terminfo issue.

aamir-sultan commented 10 months ago

Hello @uncomfyhalomacro,

Does it mean that my terminfo has to do something with it? I mean, do I need to do something or it means that the we need to do something to wezterm to get it fixed.

ninjalj commented 10 months ago

At first sight, the shell seems to think the cursor is on the prompt line. How is your prompt defined? Which shell are you using?

aamir-sultan commented 10 months ago

Its bash. Following is the path to https://github.com/aamir-sultan/dotfiles/blob/main/bash/.bash_prompt to my prompt. I believe it seems like a good catch. I am seeing some improvement. Will be back shortly.

aamir-sultan commented 10 months ago

The issue was in the prompt style. Which was coincidently changed during the same time as wezterm installation and setup. Bold style was being set twice for the prompt symbol. I have removed it now and the terminal seems to be working correctly.

Thanks @uncomfyhalomacro and @ninjalj for your time and consideration and thanks for this awesome product.

github-actions[bot] commented 9 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.