playlist does not clear properly

to recreate:

add directory to playlist -> a or A
start track -> enter (on playlist item)
clear playlist -> C
(playlist section becomes empty but current song still plays) (this is ok)
add another directory to now "empty" playlist -> a or A

at this point the next song isn't selected only from current playlist but from a playlist composed from the current displayed one and the old cleared one instead, (bug i suppose)

how the next song is started doesn't matter:
end of the current song playng,
starting new song with enter on playlist tab,
changing to next song with n
have the same result, the actual playlist is composed now of old (not shown in playlist tab) and new items (visible)

Forums:

both on 1:2.6.0~svn-r2949-2 (ubuntu's apt repository) and 2.6-alpha3 (compiled from git repository source), running on ubuntu 17.10 (gnome desktop) with ALSA

It is a known behaviour - Moc always uses the old playlist. It keeps an internal (server-side) playlist containing only what was present at the time playback started. You can observe this behaviour also using files pane. Imagine a directory with 2 tracks called 1.mp3 and 3.mp3. When you play 1.mp3 and while it goes add another file 2.mp3, Moc will ignore it and progress directly to 3.mp3.

Anyway, after any change in playlist you just have to restart playback for Moc to refresh its internal playlist. There is a related problem with shuffling which is not as random as it should be...

how should i restart playback except for closing it? the s key doesn't actually do it

Probably by choosing "Go" (Enter by default) on any playlist entry.

Pressing "s" should stop playback (it is not needed) and pressing "enter" on the new playlist should play just the new one. If it doesn't work for you, then something weird is happening and I can't reproduce it right now.

When I repeat your procedure, MOC plays the old playlist till the end and then proceeds to the new one. Pressing "enter" on any song in the new playlist discards the current playlist and MOC uses only new one.

for me, now on 26-alpha3 even pressing enter on the new playlist keeps playing old items, for example
add folder -> enter on playlist element -> clear playlist (C) -> add another directory (only this items are then shown) -> enter on new playlist song -> next song with n key for a cople of times and eventually one of the elements of the old playlist plays

Hmm, I don't know why it is like that. Did you change "SyncPlaylist" option? What are your settings of Shuffle and Repeat?

these are my settings from the config file, i didn't change anything after i opened moc

MusicDir = /home/this/matteo/Music/
Shuffle = yes
AutoNext = yes
FormatString = "%(a:"%a-":"")%(t:"%t":"")"
SoundDriver = ALSA:JACK:OSS
HideFileExtension = no
ShowFormat = yes
ShowTime = yes
ShowTimePercent = no
Theme = nightly_theme
XTermTheme = nightly_theme
Precache = yes
SavePlaylist = yes
SyncPlaylist = no
PlaylistNumbering = yes
FollowPlayedFile = yes
PlaylistFullPaths = yes

apparently with SyncPlaylist = yes the problem disappears