Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Strange toggleterm output. "exit $?" #336

Open
miroshQa opened this issue Aug 1, 2024 · 2 comments
Open

bug: Strange toggleterm output. "exit $?" #336

miroshQa opened this issue Aug 1, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@miroshQa
Copy link

miroshQa commented Aug 1, 2024

Neovim version (nvim -v)

0.10

Operating system/version

Linux

Describe the bug

image
When I run a task I always see the strange output "exit$" at the beginning and at the end. It's pretty ugly. How can this be fixed? I use overseer with integration for toggleterm

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. Install my repo
  2. Run any task using overseer

Expected Behavior

image
I want to see only this

Minimal example file

// rust file
fn main() {
    let var = 2;
    println!("Hello, world!");
}

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  { "stevearc/dressing.nvim", config = true },
  {
  'stevearc/overseer.nvim',
  cmd = { "OverseerRun", "OverseerRestartLast" },
  config = function()
    require("overseer").setup({
      templates = { "builtin", "user.cpp_build" },
      ---@diagnostic disable-next-line: assign-type-mismatch
      strategy = {
        "toggleterm",
        -- load your default shell before starting the task
        use_shell = true,
        -- overwrite the default toggleterm "direction" parameter
        direction = "tab",
        -- have the toggleterm window close and delete the terminal buffer
        -- automatically after the task exits
        close_on_exit = false,
        -- have the toggleterm window close without deleting the terminal buffer
        -- automatically after the task exits
        -- can be "never, "success", or "always". "success" will close the window
        -- only if the exit code is 0.
        quit_on_exit = "never",
        -- open the toggleterm window when a task starts
        open_on_start = true,
        -- mirrors the toggleterm "hidden" parameter, and keeps the task from
        -- being rendered in the toggleable window
        hidden = false,
      },
    })
  end,
},
{
    'akinsho/toggleterm.nvim',
    version = "*",
    lazy = true,
    config = function()


      require("toggleterm").setup({
        open_mapping = "<C-t>",
        autochdir = true,
        terminal_mappings = true,
        shade_terminals = false,
        direction = "float",
        float_opts = {
          title_pos = "center",
        },
      })

      vim.api.nvim_command 'autocmd TermOpen * startinsert' -- starts in insert mode
      vim.api.nvim_command 'autocmd TermOpen * setlocal nonumber' -- no numbers
      vim.api.nvim_command 'autocmd TermEnter * setlocal signcolumn=no' -- no sign column
      vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Go to normal mode' })
    end
  }
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

No response

@miroshQa miroshQa added the bug Something isn't working label Aug 1, 2024
@miroshQa
Copy link
Author

miroshQa commented Aug 1, 2024

UPDATE: I don't see this text if I set " use_shell = false". But it doesn't suit me because I still want to see the commands that have been run
image

@Zaunei
Copy link

Zaunei commented Sep 15, 2024

UPDATE: I don't see this text if I set " use_shell = false". But it doesn't suit me because I still want to see the commands that have been run

I run into the same problem. This also breaks the safety check for terraform apply in my case:
Screenshot 2024-09-15 at 21 42 25@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants