On Fri, Feb 12, 2021 at 3:47 PM Bastian Beranek wrote: > > Hey Juri, > > just to let you know, that I've found a problem with my patch on > text-mode frames. If I create multiple tabs one after another they > start to appear in a second row and visuals begin to glitch. > > I'll try to understand why that is happening. I found out what the problem was. I had customized tab-bar-select-tab-modifiers in my .emacs and the :set function of that variable contained (tab-bar-mode -1) followed by (tab-bar-mode 1). For some reason this caused issues (to reproduce this, apply my v8.patch, create test.el (as below) and start emacs as follows: $ cat test.el (customize-set-variable 'tab-bar-select-tab-modifiers '(super)) (customize-set-variable 'tab-bar-show 1) $ src/emacs -nw -Q -l test.el and then create two or more tabs (C-x t 2) I have now modified the set function to: diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 87c9fd719d..4e47ae2c10 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -89,8 +89,9 @@ tab-bar-select-tab-modifiers :set (lambda (sym val) (set-default sym val) ;; Reenable the tab-bar with new keybindings - (tab-bar-mode -1) - (tab-bar-mode 1)) + (when tab-bar-mode + (tab-bar-mode -1) + (tab-bar-mode 1))) :group 'tab-bar :version "27.1") This seems to fix the issue. I can't say I fully understand why though. It must have something to do with running tab-bar--update-tab-bar-lines in early initialization? We could also wrap the call to tab-bar--update-tab-bar-lines. Please find the full v9 patch attached. Cheers Bastian