Open shadow-absorber opened 11 months ago
This will not insert newline and title, but just clear lyrics from previous song, as clyrics does outside tmux.
The problem is here:
reset -Q
clears terminal but not tmux's buffer.
Tmux buffer is cleared with tmux clear-history
but there also must be specified on what pane to clear
So the command becomes: tmux clear-history -t $TMUX_PANE
Now if tmux is not installed $TMUX_PANE
variable will not exist, so to skip error messages:
if [ -z ${TMUX_PANE} ]; then :; else tmux clear-history -t $TMUX_PANE; fi
Finally this line should be changed to:
system('reset -Q; if [ -z ${TMUX_PANE} ]; then :; else tmux clear-history -t $TMUX_PANE; fi') == 0 or print "\e[H\e[J\e[H";
This command will patch clyrics script in /usr/bin:
sudo find /usr/bin/clyrics -type f -exec sed -i "s/system('reset -Q')/system('reset -Q; if [ -z \${TMUX_PANE} ]; then :; else tmux clear-history -t \$TMUX_PANE; fi')/g" {} \;
currently if you run clyrics in tmux the new lyrics gets kinda merged with the old lyrics when a new song starts/changes to a new song meaning it gets quickly confusing to find where the lyrics start and where it ends for songs