GeorgeFilipkin / pulsemixer

CLI and curses mixer for PulseAudio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory leak when opening outside of a shell

TomRiddle01 opened this issue · comments

I use rofi to run most of my programs. Running pulsemixer through rofi will lead to pulsemixer running in the background and not in a visible interactive terminal. That behavior is correct.

The memory usage of the pulsemixer process that is not running in a visible terminal will permanently increase. As seen in this screenshot.

image
The highlighted process is the one running in the background. The other processes run in a normal terminal.

I think this might help to solve the issue:

if sys.stdout.isatty():
    # You're running in a real terminal
else:
    # You're being piped or redirected

(from: https://stackoverflow.com/questions/1077113/how-do-i-detect-whether-sys-stdout-is-attached-to-terminal-or-not)

If you hold shift when running it through rofi, rofi will open a terminal and run pulsemixer inside of it. In this case no memory leak exists.