wez / wezterm

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

How to split current pane or tab? this operation look like Windows terminal `Alt+ Shift +/-`. #6245

Open sober-wang opened 1 month ago

sober-wang commented 1 month ago

Is your feature request related to a problem? Please describe. How to split current pane or tab?

Describe the solution you'd like this operation look like Windows terminal Alt+ Shift +/-

Alien-lv426 commented 1 month ago

I use these keys. Note that wezterm seems to reverse the meaning of split vertical and split horizontal so - splits horizontally and | splits vertically here.

config.keys = {
    {
        key = '_',
        mods = 'SHIFT|ALT',
        action = act.SplitVertical({
            domain = 'CurrentPaneDomain',
        }),
    },
    {
        key = '|',
        mods = 'SHIFT|ALT',
        action = act.SplitHorizontal({
            domain = 'CurrentPaneDomain',
        }),
    },
}
keesse commented 1 month ago

@Alien-lv426 I tried this in my fresh .wezterm.lua but got this error message:

runtime error: [string "C:\Users\kees.wezterm.lua"]:16: attempt to index a nil value (global 'act') stack traceback: [string "C:\Users\kees.wezterm.lua"]:16: in main chunk

How can I correct this?

Alien-lv426 commented 1 month ago

local act = wezterm.action

or just change act to be wezterm.action

keesse commented 1 month ago

@Alien-lv426 Thanks, that solved it!