Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions config/nvim-work/lua/plugins/lazy/floaterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@ return {
{ "<leader>fx", "<cmd>FloatermKill<CR>", desc = "Kill Floaterm" },
},
init = function()
if vim.g.platform == "windows" then
-- Detect Windows properly using vim.fn.has()
local is_windows = vim.fn.has("win32") == 1 or vim.fn.has("win64") == 1

if is_windows then
-- Use pwsh if available, otherwise fallback to powershell
local shell = vim.fn.executable("pwsh") == 1 and "pwsh" or "powershell"
vim.opt.shell = shell
vim.opt.shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
vim.opt.shellredir = "-RedirectStandardOutput %s -NoNewWindow -Wait"
vim.opt.shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command"
vim.opt.shellredir = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
vim.opt.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
vim.opt.shellquote = ""
vim.opt.shellxquote = ""
-- Floaterm settings (optional)
-- Floaterm settings
vim.g.floaterm_shell = shell
vim.g.floaterm_shellcmd = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command -"
else
vim.opt.shell = "bash"
vim.g.floaterm_shell = "bash"
vim.g.floaterm_shellcmd = nil
end
vim.g.floaterm_position = 'center'
vim.g.floaterm_width = 0.8
Expand Down