Skip to content

[Bug]: module/ipc: The literal '%output%' is displayed until output is received or the command terminates (initial hook only) #3131

@SeerLite

Description

@SeerLite

Checklist

  • I have read the appropriate section in the contributing guidelines
  • I believe this issue is a problem with polybar itself and not a misconfiguration on my part
  • I have searched for other open and closed issues that may have already reported this problem
  • I have checked the known issues page for this problem.
  • I have followed the debugging guide to narrow down the problem to a minimal config.

Steps to reproduce

  1. polybar example
  2. See how %output% is displayed until 5 seconds pass

Minimal config

[bar/example]
modules-left = ipc_output
enable-ipc = true

[module/ipc_output]
type = custom/ipc
hook-0 = sleep 5; echo
initial = 1

Polybar log

notice: Parsing config file: /tmp/.psub.JkUPb1Tm6m
- config_parser: Parsing /tmp/.psub.JkUPb1Tm6m
* Created legacy ipc fifo at '/tmp/polybar_mqueue.26195'
* Opening ipc socket at '/run/user/1000/polybar/ipc.26195.sock'
notice: Listening for IPC messages (PID: 26195)
* Loaded monitor eDP-1 (1920x1080+0+0)
* Configured DPI = 96x96
* Bar geometry: 1920x24+0+0; Borders: 0,0,0,0
- bar: Attach X event sink
- bar: Attach signal receiver
- controller: Setup user-defined modules
notice: Loading module 'ipc_output' of type 'custom/ipc'
* module/ipc_output: Loaded 1 hooks
notice: Loaded 1 modules
* Starting application
- controller: Main thread id = 1
* Entering event loop (thread-id=1)
- bar: Create renderer
- renderer: Get TrueColor visual
* renderer: Using 32-bit TrueColor visual: 0xab
- renderer: Allocate colormap
- renderer: Allocate output window
- renderer: Allocate window pixmaps
- renderer: Allocate graphic contexts
- renderer: Allocate alignment blocks
- renderer: Allocate cairo components
- renderer: Load fonts
warn: No fonts specified, using fallback font "fixed"
notice: Loaded font "fixed" (name=Fixed, offset=0, file=/nix/store/bsv3xk17x3hld3qqzrs8jjf8kffbjbw3-font-misc-misc-1.1.3/lib/X11/fonts/misc/7x13-ISO8859-1.pcf.gz)
* Bar window: 0x7800001
- bar: Reconfigure window
- bar: Set window WM_NAME
- bar: Set window _NET_WM_WINDOW_TYPE
- bar: Set window _NET_WM_STATE
- bar: Set window _NET_WM_DESKTOP
- bar: Set window _NET_WM_PID
- bar: Map window
- background_manager: update_geometry
- background_manager: deactivating because there are no slices to observe
- bar: Draw empty bar
- bar: Setup tray manager
* Starting module/ipc_output
- module/ipc_output: Thread id = 2
* module/ipc_output: Rebuilding cache
- bar: Force update
* Redrawing bar window
- renderer: flush(1 geom=57x24+0+0, falloff=0)
- bar: Received expose event
- background_manager: update_geometry
- background_manager: deactivating because there are no slices to observe
- background_manager: update_geometry
- background_manager: deactivating because there are no slices to observe
- command: Sending SIGTERM to running child process (26198)
- command: Waiting for pid 26198 to finish...
- command: Exited with status 0
* module/ipc_output: Rebuilding cache
* Redrawing bar window

Expected behavior

When using module/ipc with initial set to a hook, there should be no text on the bar until the hook has output something or the command finishes running

Actual behavior

The text %output% is displayed until output is received. Sometimes when there is no output and the command exits the text %output% stays there indefinitely, but I haven't been able to reproduce with a simple config. Usually it disappears when either there's output or the command finishes running.
This doesn't happen when sending an action/hook. It only happens when running the initial hook.

Window Manager and Version

i3-gaps 4.23 (2023-10-29)

Linux Distribution

NixOS 24.05

Polybar version

polybar 3.7.1

Features: +alsa -curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor

Build type: Release
Compiler: /nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/g++
Compiler flags:  -O3 -DNDEBUG -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override
Linker flags:  -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override  -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override

Additional Context / Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions