比如我现在打开的是 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