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

Open mapping opens a second window #37

Closed
romgrk opened this issue May 10, 2021 · 6 comments
Closed

Open mapping opens a second window #37

romgrk opened this issue May 10, 2021 · 6 comments

Comments

@romgrk
Copy link
Contributor

romgrk commented May 10, 2021

Config:

require'toggleterm'.setup{
  size = 20,
  open_mapping = [[<c-space>]],
  shade_filetypes = {},
  shade_terminals = true,
  -- shading_factor = '<number>' -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light
  start_in_insert = true,
  persist_size = true,
  -- direction = 'vertical' | 'horizontal',
}

After first mapping:
Screenshot from 2021-05-10 08-09-17

After second mapping:
Screenshot from 2021-05-10 08-09-22

Can't remember what was the previous time I updated but this started happening just after I updated just now.

@akinsho
Copy link
Owner

akinsho commented May 10, 2021

Hi @romgrk, do you have set hidden on in your config? if not this is one known thing that causes this issue. If you do already use that but are still seeing this can you try a minimal config with just this plugin and see if it still causes this issue

@romgrk
Copy link
Contributor Author

romgrk commented May 10, 2021

Not reproducible with minimal config. Any idea what kind of issue might be causing this?

@akinsho
Copy link
Owner

akinsho commented May 10, 2021

@romgrk do you have an terminal related autocommands? I previously encountered this in #25 I think, the issue there being that that person didn't have set hidden on which meant when the terminal was being hidden it was being disposed of so every time it was triggered it wouldn't find the previous one.

In your screenshots it's appears to be trying to recreate terminal 1 each time, so it mustn't be finding it. Can you try toggling one terminal open, then running require('toggleterm.terminal').get_all() should return the map of all terminals. If it's empty then that would explain why the second toggle is creating a new term but not sure why the terminal wouldn't be being saved on open.

@romgrk
Copy link
Contributor Author

romgrk commented May 10, 2021

It's the same terminal, but shown in two separate windows, changes in one are reflected in the other window. I'll debug further later, unless you have any other guesses as to what might be the cause.

Here is the output:
Screenshot from 2021-05-10 10-54-10

@akinsho
Copy link
Owner

akinsho commented May 10, 2021

No nothing off the top of my head other than I think something else must be set somewhere i.e. a vim setting I'm not thinking of or an autocommand, sorry no immediate ideas/suggestions other than the classic binary settings search

@romgrk
Copy link
Contributor Author

romgrk commented May 10, 2021

Found it, custom setf terminal was conflicting with toggleterm's filetype.

@romgrk romgrk closed this as completed May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants