Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with console app started from FAR main menu (F2) #638

Closed
Maximus5 opened this issue Jul 31, 2015 · 6 comments
Closed

Problems with console app started from FAR main menu (F2) #638

Maximus5 opened this issue Jul 31, 2015 · 6 comments

Comments

@Maximus5
Copy link
Owner

Originally reported on Google Code with ID 638

Required information!
OS version: WinXP SP3 x86
ConEmu version: 120709 and June's versions
Far version (if you are using Far Manager): 2.1.1807 bis29

*Bug description*
When starting a console app from FAR main menu (F2) and the app's command line uses
redirection, sometimes stderr's output is lost and/or the console app does not work
correctly.

*Steps to reproduction*
1. Download bincmp 2.2 (latest) from http://sourceforge.net/projects/bincmp/files/bincmp2/
2. Unpack bincmp.exe into FAR's folder
3. Create the following entries in FAR main menu:
F9:  Compare Files (Binary)
    macro:post $If(APanel.SelCount == 2) F2 B 3 $Else $If (panel.item(1,0,0) == "..")
F2 B 2 $Else F2 B 1 $End $End
B:  [Menu] Compare Files (Binary)
{
1:  Compare files from different panels
    edit:< 1 "%FARHOME%\bincmp.exe" -diffs=10000 -buf=16k -t=5000 "!\!.!" "!#!\!.!"
    macro:post CtrlEnd
2:  Compare matching files (active -> passive)
    edit:< 1 "%FARHOME%\bincmp.exe" -diffs=10000 -buf=16k -t=5000 "!\!.!" "!#!\!^!.!"
    macro:post CtrlEnd
3:  Compare selected files
    edit:< 1 %FARHOME%\bincmp.exe -diffs=10000 -buf=16k -t=5000 !&
    macro:post CtrlEnd
}
4. In FAR Manager, select some binary file in the left panel, then select some file
in the right panel, press F2 (main menu), then F9 to start the comparison.
bincmp will show "Error: both files read error" (this seems to be caused by ConEmu)
in stderr (FAR's console), then FAR editor opens immediately and the error message
is lost after you close the editor.

If you do the very same steps without ConEmu, bincmp works correctly. 

Reported by dvv81@ukr.net on 2012-07-10 17:31:04

@Maximus5
Copy link
Owner Author

Reported by ConEmu.Maximus5 on 2012-07-11 22:01:46

  • Status changed: Accepted

@Maximus5
Copy link
Owner Author

This is a bug in bincmp. It ignores result of ReadFile function. Due to MSDN the program
can not rely on GetLastError only.

However, here is an update
http://conemu-maximus5.googlecode.com/files/ConEmuHk.i638.7z

Reported by ConEmu.Maximus5 on 2012-07-11 22:18:28

@Maximus5
Copy link
Owner Author

Reported by ConEmu.Maximus5 on 2012-07-11 22:18:47

  • Status changed: Fixed

@Maximus5
Copy link
Owner Author

Thank you for your comment! I guess it means that the value of Last Error may be changed
by ConEmu - but, anyway, you are right that the result of ReadFile should be checked.
I believe new version of bincmp will be released soon.

Reported by dvv81@ukr.net on 2012-07-12 15:42:10

@Maximus5
Copy link
Owner Author

I mean, Last Error WAS changed by ConEmu.
Attached update and future builds will NOT.

Reported by ConEmu.Maximus5 on 2012-07-12 16:09:18

@Maximus5
Copy link
Owner Author

generally speaking, conemu does not change LastError.
in fact ReadFile in XP does not reset LastError on success.

Reported by ConEmu.Maximus5 on 2012-07-12 17:08:57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant