treemacs icon indicating copy to clipboard operation
treemacs copied to clipboard

tab label too long

Open E3D3 opened this issue 1 year ago • 2 comments

The tab-bar label for the Treemacs window is too long, and ugly.

Below an example, from a fresh Emacs 28.2 with only Treemacs v3.2 installed (version 20250322.1303) and without any customizations done: *Treemacs-Scoped-Buffer-#<frame *Minibuf-1* GNU Emacs at e3asdas 0x5578b9f4f341>*

The Treemacs tab-bar tab occupies almost halve of the screen width, often pushing other tabs to a second line, and disturbing my overview. Switching to the next workspace with keybinding "C-c C-w n" adds another another long text to the label. Killing (instead of closing/toggling) the Treemacs window 'resets' the tab label to a single instance of the long text.

I couldn't find a customization option to set the Treemacs tab label, but maybe I missed some other easy method to set the tab label.

E3D3 avatar Mar 27 '25 09:03 E3D3

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

stale[bot] avatar May 26 '25 13:05 stale[bot]

I've now added treemacs-buffer-name-function. A small prefix is still necessary for compatibility with winum, but you can now do something like this:

(defvar name-count 0)
(setf treemacs-buffer-name-function
      (defun custom-name-fn (_)
        (format "%s*" (cl-incf name-count))))

This will produce names like " *Treemacs-Buffer-1*".

Alexander-Miller avatar May 29 '25 12:05 Alexander-Miller

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

stale[bot] avatar Jul 28 '25 15:07 stale[bot]

Closing the issue because I assume it has now been resolved.

Btw, the variable treemacs-buffer-name-prefix has also recently been added.

Alexander-Miller avatar Jul 30 '25 14:07 Alexander-Miller