{"thread":{"id":"20294","subject":"LESS env var and a pager","startedAt":"2009-07-30T07:10:23Z","lastAt":"2009-07-31T12:25:41Z","messageCount":2,"participants":["Diggory Hardy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"119155","messageId":"31718a220907300010t136885c6ldc2ea362f9c6e33@mail.gmail.com","threadId":"20294","inReplyTo":null,"subject":"LESS env var and a pager","fromName":"Diggory Hardy","fromEmail":"diggory.hardy@gmail.com","sentAt":"2009-07-30T07:10:23Z","receivedAt":"2009-07-30T07:10:23Z","isPatch":false,"sender":{"key":"diggory.hardy@gmail.com","avatar":null},"body":"I was recently trying to work out why when git's output is piped\nthrough a pager, it doesn't use the alternate screen buffer:\nhttps://bugs.kde.org/show_bug.cgi?id=201899\n\nConclusion: removing the X option from the LESS environ var produced\nthe results I wanted (allow mouse-wheel scrolling, output is hidden\nafter closing the pager).\nOne relevent post I found:\nhttp://article.gmane.org/gmane.comp.version-control.git/29565/match=less+frsx\n\nSo maybe it'd make sense to change this in pager.c to:\nsetenv(\"LESS\", \"FRS\", 0);\n(or even just FR:)\nsetenv(\"LESS\", \"FR\", 0);\n\nJust a suggestion of what seems preferable to me.\n"},{"id":"119260","messageId":"31718a220907310525v681eb2c4l53c41fdec32f3f72@mail.gmail.com","threadId":"20294","inReplyTo":"31718a220907300010t136885c6ldc2ea362f9c6e33@mail.gmail.com","subject":"Re: LESS env var and a pager","fromName":"Diggory Hardy","fromEmail":"diggory.hardy@gmail.com","sentAt":"2009-07-31T12:25:41Z","receivedAt":"2009-07-31T12:25:41Z","isPatch":false,"sender":{"key":"diggory.hardy@gmail.com","avatar":null},"body":"Unfortunately using F without X results in output no longer than one\nscreen not being displayed, since less immediately exits and anything\nless would display is immediately cleared from the screen (so it just\nlooks like the git command had no output).\n\nI looked through less's man page and didn't find any solution other\nthan also not specifying F, which is not so desirable since it's\nalways necessary to press 'q' to exit less and previous output is not\nvisible on the terminal.\n\n[So don't follow my first suggestion.]\n\nOn 30/07/2009, Diggory Hardy <diggory.hardy@gmail.com> wrote:\n> I was recently trying to work out why when git's output is piped\n> through a pager, it doesn't use the alternate screen buffer:\n> https://bugs.kde.org/show_bug.cgi?id=201899\n>\n> Conclusion: removing the X option from the LESS environ var produced\n> the results I wanted (allow mouse-wheel scrolling, output is hidden\n> after closing the pager).\n> One relevent post I found:\n> http://article.gmane.org/gmane.comp.version-control.git/29565/match=less+frsx\n>\n> So maybe it'd make sense to change this in pager.c to:\n> setenv(\"LESS\", \"FRS\", 0);\n> (or even just FR:)\n> setenv(\"LESS\", \"FR\", 0);\n>\n> Just a suggestion of what seems preferable to me.\n>\n"}]}