fix(startup): make recovery mode work without --headless (#24477)

This commit is contained in:
zeertzjq
2023-07-25 19:02:39 +08:00
committed by GitHub
parent 7668f89d5b
commit c0fa721ade
3 changed files with 25 additions and 13 deletions

View File

@@ -305,6 +305,16 @@ int main(int argc, char **argv)
}
}
if (GARGCOUNT > 0) {
fname = get_fname(&params, cwd);
}
// Recovery mode without a file name: List swap files.
// In this case, no UI is needed.
if (recoverymode && fname == NULL) {
headless_mode = true;
}
#ifdef MSWIN
// on windows we use CONIN special file, thus we don't know this yet.
bool has_term = true;
@@ -336,16 +346,6 @@ int main(int argc, char **argv)
ui_client_channel_id = rv;
}
if (GARGCOUNT > 0) {
fname = get_fname(&params, cwd);
}
// Recovery mode without a file name: List swap files.
// In this case, no UI is needed.
if (recoverymode && fname == NULL) {
headless_mode = true;
}
TIME_MSG("expanding arguments");
if (params.diff_mode && params.window_count == -1) {