Skip to content

Commit

Permalink
Remove connect script in favor of lua
Browse files Browse the repository at this point in the history
  • Loading branch information
erichlf committed May 23, 2024
1 parent 1f8ba3a commit 68bf099
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 38 deletions.
37 changes: 0 additions & 37 deletions bin/connect_to_devcontainer.sh

This file was deleted.

17 changes: 16 additions & 1 deletion lua/devcontainer-cli/devcontainer_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,22 @@ function M.create_connect_cmd()
group = au_id,
callback =
function()
local connect_command = {config.nvim_plugin_folder .. "/bin/connect_to_devcontainer.sh"}
-- local connect_command = {config.nvim_plugin_folder .. "/bin/connect_to_devcontainer.sh"}
local connect_command = {}
if vim.env.TMUX ~= "" then
connect_command = {"tmux split-window -h -t \"$TMUX_PANE\""}
elseif vim.fn.executable("allacrity") == 1 then
connect_command = {"alacritty --working-directory . --title \"Devcontainer\" -e"}
elseif vim.fn.executable("gnome-terminal") == 1 then
connect_command = {"gnome-terminal --"}
elseif vim.fn.executable("iTerm.app") == 1 then
connect_command = {"iTerm.app"}
elseif vim.fn.executable("Terminal.app") == 1 then
connect_command = {"Terminal.app"}
else
vim.notify("No supported terminal emulator found.", vim.log.levels.ERROR)
end

table.insert(connect_command, dev_command)
local command = table.concat(connect_command, " ")
vim.schedule(
Expand Down

0 comments on commit 68bf099

Please sign in to comment.