fix handling external console editor

This commit is contained in:
Andrzej Rybczak
2009-03-04 22:21:32 +01:00
parent 6ad80aeed5
commit 31dcb27789

View File

@@ -276,15 +276,9 @@ void Lyrics::Edit()
{ {
system(("/bin/sh -c \"" + Config.external_editor + " \\\"" + Filename + "\\\"\"").c_str()); system(("/bin/sh -c \"" + Config.external_editor + " \\\"" + Filename + "\\\"\"").c_str());
// below is needed as screen gets cleared, but apparently // below is needed as screen gets cleared, but apparently
// ncurses doesn't know about it, so we need to clear it // ncurses doesn't know about it, so we need to reload main screen
// for real and then restore it endwin();
clear(); initscr();
curs_set(1);
curs_set(0);
myScreen->Refresh();
MPD::StatusChanges ch;
ch.StatusFlags = 1;
NcmpcppStatusChanged(Mpd, ch, 0);
} }
else else
system(("nohup " + Config.external_editor + " \"" + Filename + "\" > /dev/null 2>&1 &").c_str()); system(("nohup " + Config.external_editor + " \"" + Filename + "\" > /dev/null 2>&1 &").c_str());