Closed wlhlm closed 10 years ago
I think the better option is to display the below the status line and not to overwrite the previous lines in the terminal buffer that do not belong to mpv.
Normally, the status line is the last line on the terminal (at least in the case if there was already enough other output on the terminal before calling mpv), so reserving an extra line for terminal OSD would be weird.
Maybe it should just try to keep track of how many lines it has written before, and print an extra newline when outputting the first line. On the other hand, trying to be too clever with this terminal stuff will probably fail anyway.
Alternatively, you could disable output of these messages with the --no-term-osd
option.
Should be fixed in git master now. Report if you have problems.
I won't add this to 0.3.x though - too many/intrusive changes.
With the current version (710a45a3864573b18b35f38c5ea8c10bd9e4c63d) there is a bug: mpv would print an addtional line above the statusline every time the terminal-osd is updated. Sample output:
$ mpv file.mp3
Volume: 28 %
Volume: 28 %
Volume: 28 %
(Paused) A: 00:00:12 / 00:05:11 (4%)
Doesn't happen here. Did you compile with ncurses? What terminal emulator? Output of echo $TERM
?
I've just rebuilt mpv-git
from the AUR (Archlinux). I'm not sure whether ncurses is enabled by default, but it's neither disabled nor enabled in the (AUR-)build script. At least my binary depends on libncursesw.so
.
My terminal is rxvt-unicode-9.19
and $TERM
is xterm-256color
.
I'm also using urxvt, and here $TERM
is rxvt-unicode
. Can you try to set that? E.g.:
TERM=rxvt-unicode mpv ...
Also, I just pushed a commit which fixes the fallback if termcap/terminfo are not available. (ncurses provides terminfo.)
With TERM=rxvt-unicode
, it works as expected. So the problem is with xterm256-color
where mpv
(1cd1fb9e5c39aa858b4f456ce92b506e5f50b768) in the default configuration doesn't even show the terminal-osd and you have to use --term-osd=force
.
It also doesn't work correctly with TERM=xterm
. That's interesting since, in my experience, xterm
as well as xterm-256color
are the most compatible with most TUI programs.
The only thing I could imagine is that you really must use tputs() instead of printf() to output the escape sequences.
Hm no, that doesn't change anything. No idea then. I suppose it's not possible that the xterm terminfo entry is broken.
It was a simple mistake. Should work in git master now.
:+1: works now correctly.
One minor thing is, that the terminal-osd isn't enabled by default in any of the $TERM
configurations and I have to use --term-osd=force
.
Thanks for testing this.
One minor thing is, that the terminal-osd isn't enabled by default in any of the $TERM configurations and I have to use --term-osd=force.
That's as intended. If there is a video window, no term OSD is used (just the status line is printed). If there is no video window, term OSD is enabled. $TERM isn't even checked, except for handling the actual output.
In my case, there is no video window. I'm using mpv
to play some audio files but it will open an annoying window when the there is a cover art so I've put vo=null
in my config file.
Use --no-video
, or --audio-display=no
(the latter disables display of covert art embedded in audio files).
Thank you.
I have
mpv
running with the following setting:This silences the by default quite verbose command line output and normally just displays the status line.
Now, when I'm using
mpv
to play some audio file, the terminal looks like this:When I'm changing the volume,
mpv
outputs the volume above the status line:It overwrites the shell prompt (
$ mpv file.mp2
). After some time the volume output disappears and leaves a blank line:I think the better option is to display it below the status line and not to overwrite the previous lines in the terminal buffer that do not belong to mpv.
I'm not sure whether there are other elements, that also display above the status line.