nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 88f71ff35d421d5b6610946f2b1b84a0eaa0d4e0
parent 54d760b9f533b26c36e915743fe521a05b72aa23
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Fri, 21 May 2021 08:05:44 +0530

Suppress session open failure msg in picker mode

Diffstat:
Msrc/nnn.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -3918,7 +3918,7 @@ static bool load_session(const char *sname, char **path, char **lastdir, char ** session_header_t header; FILE *fsession; bool has_loaded_dynamically = !(sname || restore); - bool status = FALSE; + bool status = (sname && g_state.picker); /* Picker mode with session program option */ char ssnpath[PATH_MAX]; char spath[PATH_MAX]; @@ -3942,11 +3942,15 @@ static bool load_session(const char *sname, char **path, char **lastdir, char ** fsession = fopen(spath, "rb"); if (!fsession) { - printmsg(messages[MSG_SEL_MISSING]); - xdelay(XDELAY_INTERVAL_MS); + if (!status) { + printmsg(messages[MSG_SEL_MISSING]); + xdelay(XDELAY_INTERVAL_MS); + } return FALSE; } + status = FALSE; + if ((fread(&header, sizeof(header), 1, fsession) != 1) || (header.ver != SESSIONS_VERSION) || (fread(&cfg, sizeof(cfg), 1, fsession) != 1))