tmux icon indicating copy to clipboard operation
tmux copied to clipboard

Bug: Custom padding with zero-width space breaks the status bar

Open luftaquila opened this issue 3 weeks ago โ€ข 4 comments

Describe the bug

Customizable padding feature added by #352 makes the status bar break when using zero-width space as a padding.

To Reproduce

  1. Add following lines to .tmux.conf, which are from #352
set -g @dracula-left-pad 'โ€‹'  # THERE IS A ZERO WIDTH SPACE HERE
set -g @dracula-right-pad 'โ€‹'  # USING '' WITHOUT A PADDING CHARACTER WON'T WORK

Note that this is not a empty string. There is a U+200B ZERO WIDTH SPACE between the quotes.

  1. tmux kill-server && tmux

Expected behavior

Plugins without paddings to be appeared.

Screenshots

Image

Status bar is stacked every time it's refreshed. It seems like that the last amount of used ZWSP characters are wrapped to the next line.

System

  • OS: macOS 26.1
  • Tmux Version: 3.6a

luftaquila avatar Dec 16 '25 04:12 luftaquila

๐Ÿ“ CodeRabbit Plan Mode

Generate an implementation plan and prompts that you can use with your favorite coding agent.

  • [ ] Create Plan
Examples
You can configure auto-planning by selecting labels in the issue_enrichment configuration.

๐Ÿ”— Similar Issues

Related Issues

  • https://github.com/dracula/tmux/issues/366
  • https://github.com/dracula/tmux/issues/351
  • https://github.com/dracula/powerlevel10k/issues/14
  • https://github.com/dracula/tmux/issues/364

๐Ÿ”— Related PRs

dracula/tmux#352 - feat/making plugin padding customizable [merged] dracula/tmux#367 - Fix status bar rendering in tmux 3.6 [merged]

๐Ÿ‘ค Suggested Assignees


๐Ÿงช Issue enrichment is currently in early access.

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

coderabbitai[bot] avatar Dec 16 '25 04:12 coderabbitai[bot]

I think it would be better to make no-padding when there is a specific word, instead of using an U+200B character.

For example, following change fixes the issue:

set -g @dracula-left-pad false
set -g @dracula-right-pad false
diff --git a/scripts/dracula.sh b/scripts/dracula.sh
index 47b7a1f..e647aa5 100755
--- a/scripts/dracula.sh
+++ b/scripts/dracula.sh
@@ -41,6 +41,9 @@ main() {
   left_pad=$(get_tmux_option "@dracula-left-pad" " ")
   right_pad=$(get_tmux_option "@dracula-right-pad" " ")
 
+  if [ "$left_pad" = false ]; then left_pad=""; fi
+  if [ "$right_pad" = false ]; then right_pad=""; fi
+
   narrow_mode=$(get_tmux_option "@dracula-narrow-mode" false)
   if $narrow_mode; then
     IFS=' ' read -r -a plugins <<< $(get_tmux_option "@dracula-narrow-plugins" "compact-alt battery network weather")

If any maintainer agree with this idea, I'll write a PR for this. Thank you!

luftaquila avatar Dec 16 '25 04:12 luftaquila

I have followed your instructions on

macos 26.2
tmux 3.6a
alacritty

as well as

fedora 43
tmux 3.5a
alacritty

and i could not reproduce.

I would nevertheless be open to testing and merging your pr. it should not break any old configs after all

Theoreticallyhugo avatar Dec 16 '25 23:12 Theoreticallyhugo

Thank you. I've suspected my custom plugin rainbarf and removed it, but issue was still. I'm not sure what causes the ui to break, but I believe it is better to use a typeable word instead of unicode character. I'll write a PR soon.

luftaquila avatar Dec 17 '25 01:12 luftaquila