m0_46696082 2025-06-17 17:49 采纳率: 0%
浏览 6

wezterm 的这个 CurrentPaneDomain 不起作用应该怎么办,是用 lua 配置的

比如我现在打开的是 cmd,启动时默认打开的是 powershell,分割后打开的是 powershell

-- 分割窗格
-- CTRL+\: 垂直分割(当前窗格域)
{
    key = [[\]],
    mods = 'CTRL',
    action = act.SplitVertical{
        domain = 'CurrentPaneDomain'
    }
}, 
-- SUPER+\: 水平分割(当前窗格域)
{
    key = [[\]],
    mods = mod.SUPER,
    action = act.SplitHorizontal{
        domain = 'CurrentPaneDomain'
    }
},

和这部分有关吗

local platform = require('utils.platform')
local ssh = require('utils.ssh')

local options = {
   default_prog = {},
   launch_menu = {},
}

-- 动态生成 SSH 启动菜单项
local ssh_menu_items = {}
for _, server in ipairs(ssh.servers) do
    table.insert(ssh_menu_items, {
        label = server.label,
        args = ssh.get_ssh_args(server),
    })
end

if platform.is_win then
   options.default_prog = { 'pwsh', '-NoLogo', '-WorkingDirectory', 'D:\\note' }
   options.launch_menu = {
      { label = 'pwsh', args = { 'pwsh', '-NoLogo', '-WorkingDirectory', 'D:\\note'  } },
      { label = 'Command Prompt', args = { 'cmd' } },
    -- 添加 git bash 并进入 D:/note
    {
      label = 'Git Bash',
      args = { 'D:\\program\\Git\\bin\\bash.exe' }
    },
      { label = 'PowerShell Desktop', args = { 'powershell' } },
      -- { label = 'Nushell', args = { 'nu' } },
      -- { label = 'Msys2', args = { 'ucrt64.cmd' } },
    -- 添加 ssh,需要手动输入密码,可以配置 ssh 密钥免输密码
    --   {
    --      label = 'Cygnus',
    --      args = { 'ssh', 'cygnus@192.168.177.129', '-p', '22' },
    --   }, 
    -- 插入动态生成的 SSH 菜单项
    table.unpack(ssh_menu_items),
   }
elseif platform.is_mac then
   options.default_prog = { '/opt/homebrew/bin/fish', '-l' }
   options.launch_menu = {
      -- { label = 'Bash', args = { 'bash', '-l' } },
      -- { label = 'Fish', args = { '/opt/homebrew/bin/fish', '-l' } },
      -- { label = 'Nushell', args = { '/opt/homebrew/bin/nu', '-l' } },
      -- { label = 'Zsh', args = { 'zsh', '-l' } },
   }
elseif platform.is_linux then
   options.default_prog = { 'fish', '-l' }
   options.launch_menu = {
      { label = 'Bash', args = { 'bash', '-l' } },
      { label = 'Fish', args = { 'fish', '-l' } },
      { label = 'Zsh', args = { 'zsh', '-l' } },
   }
end

return options
  • 写回答

6条回答 默认 最新

  • 阿里嘎多学长 2025-06-17 17:49
    关注

    阿里嘎多学长整理AIGC生成,因移动端显示问题导致当前答案未能完全显示,请使用PC端查看更加详细的解答过程

    解决方案

    wezterm 的 CurrentPaneDomain 配置项用于控制当前窗格域的行为。然而,在你的 Lua 配置文件中,可能存在一些错误或不正确的使用方式。

    首先,让我们检查一下你的配置文件中是否正确地使用了 CurrentPaneDomain。在你的配置文件中,你使用了 act.SplitVertical 来垂直分割窗格,但是你没有指定 CurrentPaneDomain

    你可以尝试将 CurrentPaneDomain 添加到 act.SplitVertical 中,例如:

    {
        key = [[\]],
        mods = 'CTRL',
        action = act.SplitVertical{ domain = act.SplitDomain.CurrentPane }
    }
    

    这将使得当前窗格域垂直分割,并且保持当前窗格域的状态。

    如果你仍然遇到问题,可以尝试检查你的配置文件中的其他部分,确保没有其他的配置项冲突或错误。

    如果你需要更多帮助,可以提供更多的配置文件代码或详细的错误信息。

    评论

报告相同问题?

问题事件

  • 修改了问题 6月17日
  • 修改了问题 6月17日
  • 修改了问题 6月17日
  • 修改了问题 6月17日
  • 展开全部