akinsho / toggleterm.nvim

A neovim lua plugin to help easily manage multiple terminal windows
GNU General Public License v3.0
4.06k stars 170 forks source link

[BUG] Equal height and weight keymap is not working with toggle term window #550

Closed Demianeen closed 4 months ago

Demianeen commented 4 months ago

Is there an existing issue for this?

Current Behavior

When the toggle term terminal is open, the equal height and weight keymap doesn't do anything.

https://github.com/akinsho/toggleterm.nvim/assets/51330172/2cb9d246-4c19-4427-b040-81d051650a2e

Expected Behavior

The height/width would become equal across windows

Steps To Reproduce

  1. With environment below
  2. Use zero config, setup like:
    return {
    'akinsho/toggleterm.nvim',
    opts = {},
    }
  3. Open toggleterm with :Toggleterm
  4. Try to use = (equal height/width across terminals)
  5. See that nothing happens
  6. Try to use any other keymap like max height (_) or increase decrease width
  7. See that they are working

Environment

- OS: MacOS Sonoma 14.2.1 (23C71)
- neovim version: v0.10.0-dev-2273+g21df0cdb8 RelWithDebInfo 
- LuaJIT 2.1.1706708390
- Shell: zsh

Anything else?

No response

akinsho commented 4 months ago

Toggleterm controls the size of the window using the size parameter so = will not work as changing the size must go through toggleterm mechanism to make controlling the windows easier to manage

Demianeen commented 4 months ago

Toggleterm controls the size of the window using the size parameter so = will not work as changing the size must go through toggleterm mechanism to make controlling the windows easier to manage

Can you control the size without creating new windows every time? I think it might be useful for those who come with the same problem in the future

akinsho commented 4 months ago

It's possible but this isn't something that I designed this for, especially when it comes to tiling terminals in horizontal or vertical directions having a consistent size is useful. As I mention in the README I created this plugin with quite simple/limited functionality in mind. Every bit of increased complexity (which this is despite seeming quite simple) is not worth the maintenance burden for me. As always happy to review well thought out PRs though