less.exe causes cmd.exe to crash
Brought to you by:
bozho
Download less.exe from http://www.greenwoodsoftware.com/less/download.html or http://unxutils.sourceforge.net/
Try to run less.exe on any text file.
The output flashes, then disappears, leaving you with a command-line
>less foo.txt
when issuing the exit command ":q" cmd.exe crashes. The stack shows it's a crash from "operator new" invoked from "ConsoleHook.dll" inside cmd.exe.
This happens both x64 and x86, on Win7 and IIRC on Vista as well.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
have the same issue, would be nice if that is fixed some when, though i'm not using less too often, its a handy tool when working with command line
Last edit: Anonymous 2013-11-26
I think you can solve this by setting the environment variable `LESS` to "FRSX" (for example with $env:LESS = 'FRSX' in PowerShell).
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Would also love to see this fixed. This is the only thing that is stopping me from ditching normal windows console in favour of Console2. For me the screen just flashes and then the whole console crashes.
Last edit: Anonymous 2015-12-02
This behavior is triggered by the same problem as described in bug 2944920.
I investigated the problem in a debugger. In the comments for the older bug, I've described my findings, along with some possible partial fixes and workarounds. Here's a link if you're interested:
https://sourceforge.net/tracker/?func=detail&aid=2944920&group_id=43764&atid=437332
If all you need is "less," then the simplest workaround is to switch to Cygwin. Their less does not cause Console2 to crash.
See related forum thread: https://sourceforge.net/projects/console/forums/forum/143117/topic/3475713
I think I have fixed this. The fix is committed, it will be available in the next build.
Cheers,
--
Marko
Nope, not fixed.
I'm stilling seeing this problem with Console 2.00.147 64-bit on Windows 7 Enterprise 64-bit using the less executable from GNUWin32.
also seeing this with win7 x64
this is a real pain for me as i use less VERY often and pretty much cant live w/o it.
does anyone have a workaround (other than switching to x86) for this?
PS: my observed behavior is that the console app just dies instantly when starting less.
as a workaround i have placed a win shortcut pointing to cygwin's less into the gunwin32/bin folder. for this to work u must add .lnk to PATHEXT, e.g. PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.lnk
I am also seeing this. Setting LESS=FSRX does prevent the crash, but also prevents less from working properly.
For me, LESS=X works perfectly.
I've found using the --no-init (or -X) option solves the problem, but I don't know if this creates any other problems. So far, it seems to be working. This could the same as what's suggested in the previous post, but I am not sure what "LESS=X" means. I guess it means this option is used automatically. Thanks.
Last edit: amannuc 2014-08-16