Tuesday, July 12, 2016

git log exit code 141?

Something's that been bugging me for a while now is that when I do a `git log` command and quit before scrolling through all the output, my terminal prompt shows my last command (the git log) exited non-zero with status code 141.

I have git configured to use `less -+S` as the pager.

The answer turns out to be really straightforward, but took me a little bit of internet searching. I am capturing the learning here to save my future self the research and possibly anyone else typing the exact same thing into Google that I did ;-)

The explanation:

  • Git pipes the logs into less
  • I quit the less process, which sends a SIGPIPE signal (13) to the underlying git process streaming the logs
  • git catches the interrupt and exits prematurely and per POSIX convention returns 128 + the SIGPIPE status ==> 141 to indicate that it was terminated by signal 13
The background:
  1. http://stackoverflow.com/questions/19120263/why-exit-code-141-with-grep-q
  2. http://www.pixelbeat.org/programming/sigpipe_handling.html
  3. http://unix.stackexchange.com/questions/99112/default-exit-code-when-process-is-terminated/99134#99134

78 comments:

  1. Is there any way to fix the exit code so that it is 0?

    ReplyDelete
    Replies
    1. Yes, change your git pager configuration to just `less`

      Delete
    2. I have tried setting core.pager to 'less' as well as removing all color-related env vars, and I continue to get error 141 when I quit 'git log'. Any more ideas?

      Delete
    3. I set "pager = cat | less" to force all of stdin to be read before passing it to less

      :)

      Delete
  2. This bug can be seen often. Hope you were able to resolve this issue.

    Please click on the link below.
    Best Advanced Excel classes in Bangalore

    ReplyDelete
  3. Nice post keep do posting The Info was too good, for more information regarding the technology Click
    Amazon web Services Training
    Professional Salesforce CRM Training
    Salesforce Online Training in Bangalore

    ReplyDelete
  4. myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance

    ReplyDelete
  5. When such problems arise, I try to immediately solve it because in the future it can lead to serious malfunctions.

    ReplyDelete
  6. Greetings! I just wanted to thank you for the published entry! You have helped us too much! We are glad we have found this source here.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Nice post I have been searching for a useful post like this on salesforce course details, it is highly helpful for me and I have a great expereince with this
    Salesforce Training  which is a best institute for career building program.

    ReplyDelete
  10. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    workday studio online training
    best workday studio online training
    top workday studio online training

    ReplyDelete
  11. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. erek erek

    ReplyDelete
  12. They can't figure out why their co-worker isn't pulling his or her own weight and why the sales manager isn't doing anything about it. Salesforce training in Chennai

    ReplyDelete
  13. Hey, this day is too much good for me, since this time I am reading this enormous informative article here at my home. Thanks a lot for massive hard work. polaris ranger

    ReplyDelete
  14. Succeed! It could be one of the most useful blogs we have ever come across on the subject. Excellent info! I’m also an expert in this topic so I can understand your effort very well. Thanks for the huge help. log splitter

    ReplyDelete
  15. Hey, this day is too much good for me, since this time I am reading this enormous informative article here at my home. Thanks a lot for massive hard work. creditcard online abn amro

    ReplyDelete
  16. A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. goedkope taxi rotterdam

    ReplyDelete
  17. อีกทั้งเรายังให้บริการ เกมสล็อต ยิงปลา แทงบอลออนไลน์ รองรับทุกการใช้งานในอุปกรณ์ต่าง ๆ HTML5 คอมพิวเตอร์ แท็บเล็ต สมาทโฟน คาสิโนออนไลน์ และมือถือทุกรุ่น เล่นได้ตลอด 24ชม. ไม่ต้อง Downloads เกมส์ให้ยุ่งยาก ด้วยระบบที่เสถียรที่สุดในประเทศไทย

    ReplyDelete
  18. หาคุณกำลังหาเกมส์ออนไลน์ที่สามารถสร้างรายได้ให้กับคุณ เรามีเกมส์แนะนำ เกมยิงปลา รูปแบบใหม่เล่นง่ายบนมือถือ คาสิโนออนไลน์ บนคอม เล่นได้ทุกอุปกรณ์รองรับทุกเครื่องมือ มีให้เลือกเล่นหลายเกมส์ เล่นได้ทั่วโลกเพราะนี้คือเกมส์ออนไลน์แบบใหม่ เกมยิงปลา

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. Baccarat is money making plus it's spectacular availability. Optimal In your case it's being sold that you'll find pretty fascinating alternatives. And that is regarded as something that's very different And it's really a little something that's very happy to hit with Likely the most excellent, too, is a very positive choice. Furthermore, it's a really fascinating solution. It's the simplest way which could earn money. Superbly prepar The number of best-earning baccarat is the accessibility of making the most cash. Almost as possible is very ideal for you An alternative which may be guaranteed. To a wide variety of performance and supply And see outstanding benefits as well.บาคาร่า
    ufa
    ufabet
    แทงบอล
    แทงบอล
    แทงบอล

    ReplyDelete
  21. ได้โดยที่จะทำให้คุณนั้นสามารถสร้างกำไรจากการเล่นเกมส์เดิมพันออนไลน์ได้เราแนะนำเกมส์ชนิดนี้ให้คุณได้รู้จักก็เพราะว่าเชื่อว่าทุกคนนั้นจะต้องรู้วิธีการเล่นและวิธีการเอาชนะเกมม สล็อต าแทบทุกคนเพราะเราเคยเล่นกันมาตั้งแต่เด็กเด็กหาคุณได้เล่นเกมส์คาสิโนออนไลน์ที่คุณนั้นคุ้นเคยหรือจะเป็นสิ่งที่จะทำให้คุณสามารถที่จะได้กำไรจากการเล่นเกมได้มากกว่าที่คุณไปเล่นเกมส์คาสิโนออนไลน์ที่คุณนั้นไม่เคยเล่นมาก่อนและไม่คุ้นเคย เราจึงคิดว่าเกมส์ชนิดนี้เป็นเกมส์ที่น่าสนใจมากๆที่เราอยากจะมาแนะนำให้ทุกคนได้รู้จักและได้ใช้บริการ

    ReplyDelete
  22. Hi this is venky here to tell about that blog is usefull and topic featured in content is necessary.
    Digital marketing in Telugu

    ReplyDelete
  23. I really like your writing style, great information, thankyou for posting. 토토사이트

    ReplyDelete
  24. Cool stuff you have got and you keep update all of us. 토토사이트

    ReplyDelete
  25. This is a truly good site post. Not too many people would actually, the way you just did. I am really impressed that there is so much information about this subject that have been uncovered and you’ve done your best, with so much class. If wanted to know more about green smoke reviews, than by all means come in and check our stuff. 토토사이트

    ReplyDelete
  26. Nice to be visiting your blog once more, it has been months for me. Well this article that ive been waited for therefore long. i want this article to finish my assignment within the faculty, and it has same topic together with your article. Thanks, nice share. click here

    ReplyDelete
  27. I know this if off topic but I'm looking into starting my own blog
    and was curious what all is needed to get setup? I'm assuming having a blog like yours would cost
    a pretty penny? I'm not very internet smart so I'm not 100% positive. Any tips or advice would be greatly appreciated.

    Review my webpage - 오피사이트
    (jk)

    ReplyDelete
  28. Wonderful blog! I found it while surfing around on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Appreciate it. 토토커뮤니티

    ReplyDelete
  29. Hi there! Nice post! Please tell us when I will see a follow up! 토토커뮤니티

    ReplyDelete
  30. Thanks For Sharing such a wonderful article the way you presented is really amazing
    Best Software Training Institutes

    ReplyDelete
  31. You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. 토토사이트

    ReplyDelete
  32. This is the type of information I’ve long been trying to find. Thank you for writing this information. 릴게임

    ReplyDelete
  33. Hello There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and return to read more of your useful information. Thanks for the post. I’ll certainly comeback. 안전놀이터

    ReplyDelete
  34. Thanks for your insight for your fantastic posting. I’m glad I have taken the time to see this. 안전놀이터

    ReplyDelete
  35. Hi there! Nice stuff, do keep me posted when you post again something like this! 먹튀검증업체

    ReplyDelete
  36. Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. 먹튀검증

    ReplyDelete
  37. Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. buy real youtube views

    ReplyDelete
  38. I really like your writing style, great information, thankyou for posting. buy youtube views and likes

    ReplyDelete
  39. Hi there! Nice stuff, do keep me posted when you post again something like this! pii-email

    ReplyDelete
  40. Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. pii-email

    ReplyDelete
  41. I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. academic transcription services

    ReplyDelete
  42. I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. 먹튀검증

    ReplyDelete
  43. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work. 88카

    ReplyDelete
  44. Hello, this weekend is good for me, since this time i am reading this enormous informative article here at my home. 88카

    ReplyDelete
  45. This is actually the kind of information I have been trying to find. Thank you for writing this information. joker888

    ReplyDelete
  46. Thank you a bunch for sharing this with all of us you actually realize what you are talking about! Bookmarked. Please also seek advice from my site =). We could have a hyperlink change contract between us! joker123

    ReplyDelete
  47. I really like your writing style, great information, thankyou for posting. 먹튀검증

    ReplyDelete
  48. Hello There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and return to read more of your useful information. Thanks for the post. I’ll certainly comeback. kissanime alternatives

    ReplyDelete
  49. Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. 토토사이트

    ReplyDelete
  50. I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks... 대전마사지

    ReplyDelete
  51. We know that the demand for movies is getting higher day by day. With every single day, new seasons and movies are releasing. Especially during the quarantine, watching online movies is at its peak. It is evident from the online platforms of movies that they have raised their subscription charges due to high usage these days. We all wish to watch movies free of cost. So here we go, today; in this article click there , we will introduce you all to CatMouse APK, where you can watch your favourite movies online and free of cost.

    ReplyDelete
  52. beemp3: Mp3 file search engine BeeMP3 searches dozens of online sources simultaneously to find the Mp3 file you are looking for. There are no special requirements for this search engine, apart from having to beemp3 enter the name of your track, tag, or other relevant details. If you click on the search button after placing the title, you can easily find all the options available for you to play and download without any limitations.

    ReplyDelete
  53. Succeed! It could be one of the most useful blogs we have ever come across on the subject. Excellent info! I’m also an expert in this topic so I can understand your effort very well. Thanks for the huge help. 바둑이게임

    ReplyDelete
  54. Impressive web site, Distinguished feedback that I can tackle. Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards. https://www.abercrombieand-fitch.com.co/

    ReplyDelete
  55. I can’t imagine focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material. This is great content. www.digitalanalog.in

    ReplyDelete
  56. You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. www.digitalanalog.in

    ReplyDelete
  57. You understand your projects stand out of the crowd. There is something unique about them. It seems to me all of them are brilliant. 먹튀검증

    ReplyDelete
  58. 바카라사이트
    This is my website and it has been very helpful. How did you come up with this brilliant idea? Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. Please visit my website and give your opinion.

    ReplyDelete
  59. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. https://sites.google.com/view/buy-twitch-followers/

    ReplyDelete
  60. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. https://sites.google.com/view/buy-twitch-followers/

    ReplyDelete
  61. Our team are trained in dealing with the specific potential threats in these circumstances. bodyguard servicesFor individuals requiring protection, we can conduct our services with minimal intrusion to your daily activities so you can have the peace of mind of feeling protected without having to completely change your routine or disrupt your life.

    ReplyDelete
  62. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks 토토사이트

    ReplyDelete