6

I run git log command (usually with more options, irrelevant here) and then quit with q. However, after I recently installed zsh plugins to display the last command return code, I discovered that this command exits with a non-zero return code.

$ git log
$ echo $?
141

Why is this happening, is this a sign of any real underlying problem and how can I fix it?

Max Yankov
  • 12,551
  • 12
  • 67
  • 135
  • 1
    @Mureinik The proposed duplicate only explains exit code 1. – tripleee Mar 05 '19 at 09:59
  • 2
    Possible duplicate of [Why exit code 141 with grep -q?](https://stackoverflow.com/questions/19120263/why-exit-code-141-with-grep-q), or various others referring to 141 - it's because the pipe gets closed when you `q`uit. – jonrsharpe Mar 05 '19 at 10:00
  • @jonrsharpe that doesn't answer the other related questions here and is useless to me as a git user (and not a git developer) – Max Yankov Mar 05 '19 at 10:06
  • 1
    It answers the first part, why is it happening, the answers to the other parts are therefore: no; and you don't need to "fix" anything. – jonrsharpe Mar 05 '19 at 10:07
  • @jonrsharpe well it sounds like an advice to ignore code warning. May be someone can direct me into git internals then so can I understand how can I patch it there? – Max Yankov Mar 05 '19 at 10:13
  • 1
    I thought you said you *weren't* a git developer? It's really not clear what, if anything, your problem actually is. – jonrsharpe Mar 05 '19 at 10:14
  • 1
    This is due to your `LESS` config apparently. Here's a blog post from 2016 about this issue : https://www.ingeniousmalarkey.com/2016/07/git-log-exit-code-141.html – Aserre Mar 05 '19 at 10:27
  • @Aserre thanks, can you post it as answer so I can accept it please? – Max Yankov Mar 05 '19 at 10:39

0 Answers0