View Issue Details

IDProjectCategoryView StatusLast Update
0003633Far ManagerCommand Line/Executepublic2019-02-22 10:24
ReporterheilongAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Platformx64OSWindowsOS Version7
Product Version3.0 
Target VersionFixed in Version 
Summary0003633: Can't execute scripts in subdirectories
DescriptionI have the following problem since some builds ago (using 3.0 x64 5254 right now).
Typing the following on the command-line
- bat\RunApp.bat
- .\bat\RunApp.bat
- bat/RunApp.bat
- ./bat/RunApp.bat
When I press enter, the command changes to "RunApp.bat", resulting in error (since the bat file is actually in the "bat" subdirectory):
'"RunApp.bat"' is not recognized as an internal or external command,
operable program or batch file.

It's a severe issue since I'm not able to execute many common scripts for my projects
TagsCmdline Associations
Build

Activities

DrKnS

2018-08-13 23:14

administrator   bugnote:0016199

> Typing the following on the command-line

Works on my machine.
Have you tried to reproduce it without plugins/scripts/macros/custom comspec etc.?

> since some builds ago

Have you tried to narrow down this 'some'?

heilong

2018-08-13 23:32

reporter   bugnote:0016200

Moved all files from `scripts` to a backup dir, ran `far /p` (no ConEmu), reset System.Executor.Comspec* options to defaults - same behavior.
I'm gonna try some older builds and see if it starts working again at some point...

heilong

2018-08-13 23:53

reporter   bugnote:0016202

Build <= 5214 - ok
Build >= 5215 - experiencing this issue

P.S. If I just unpack the latest 5254 build and run (fully default settings), there are no issues. So it must be related to some setting that I have.

heilong

2018-08-14 00:03

reporter   bugnote:0016203

Last edited: 2018-08-14 00:03

View 2 revisions

Ok, narrowed it down to the following setting.
I have a file association like this:
File masks: *.bat;*.cmd;*.vbs;*.vbe;*.js;*.jse;*.wsf;*.wsh;*.msc;*.sh;*.pl;*.py;*.awk
Description: Script file
Execute command: "!.!"

If I remove the association or uncheck the "Execute command" checkbox, the issue doesn't happen.

DrKnS

2018-08-14 00:12

administrator   bugnote:0016205

> Execute command: "!.!"

"!.!" means "name and extension", i.e. you're asking to turn your "bat\RunApp.bat" into "RunApp.bat", and that's exactly what you get.

"!\!.!" should help (if you need that association at all).

heilong

2018-08-14 00:23

reporter   bugnote:0016206

I think I got this "!.!" from the forum (a long time ago). I don't recall why I needed this association, but it seemed to be necessary for something, at least in the past.

I also have a ton of associations with this execute command: @"!.!" for various file types that I just want to open in an editor (e.g. xml, json, txt, md, ...)
I just noticed that these also don't work (unless I change to @"!\!.!").

They used to work, but stopped since build 5215. Was some new feature added / bug fixed by this build? The ChangeLog just mentions refactoring...

DrKnS

2018-08-14 00:48

administrator   bugnote:0016207

I can't imagine why you might need !.!
It's basically a request to use a system handler, but in style.

@!.! might have been used to suppress panels flickering, but Far is smart enough these days to do it on its own so it's useless too.

> bug fixed by this build?
Sort of. Metasymbols parser used to insert the full path into !.! sometimes.

Anyway, experimental support for associations in command line was added only in 4723, so it's not like we broke something that worked for decades.

heilong

2018-08-14 13:37

reporter   bugnote:0016208

I've disabled the "!.!" handler for the script files, will see if I can find out why I had it in the first place.

For the @!.!, I've remembered the two uses I have for it. None of them are related to command line, I've added those associations long time ago, for cases when I press Enter on a particular file type. Examples:
- CHANGELOG.md - the file is open with the associated editor (Notepad2). If I don't have *.md with @!.! execute action, if I hide the panels, I can see the last command was CHANGELOG.md. With the @!.! execute action for *.md, there is no last command (Command history does show @"CHANGELOG.md").
- application.xml - without the @!.! execute action, Far enters the xml document as a tree (XMLDOM plugin, I think). For me this is undesirable, in most cases I want the document to open with the associated editor. Only when I specifically want to navigate the xml using Far, I use Ctrl-PgDn. The file association with @!.! execute action is what allows me to do so.

What I want to say is, I've only used file associations for cases when I press ENTER on a file (in which case it's obvious file is in the same directory, hence !.! is good enough).

So the way I see it, the "experimental support for associations in command line was added only in 4723", combined with a bugfix in 5215 - is what broken some things for me. I am not sure of the value of this feature, I've never found myself missing that support. I guess others have uses for it. Perhaps it can be a config setting?

heilong

2018-08-23 12:13

reporter   bugnote:0016223

I was not sure my comment got posted as I couldn't open the bug manager for several days.
@DrKnS have you seen the comment? What do you think?

DrKnS

2018-08-23 12:33

administrator   bugnote:0016224

heilong, please use !\!.! in your associations if you want them to work properly in command line invoked from arbitrary directories.

heilong

2018-08-23 12:46

reporter   bugnote:0016225

Yes, I will do that. What do you think about adding a setting which would allow NOT using file associations on the command line? I don't mind what is the default value for this setting, just personally I don't see this feature as being useful so would like to have an ability to disable it.

Issue History

Date Modified Username Field Change
2018-08-13 22:57 heilong New Issue
2018-08-13 23:14 DrKnS Note Added: 0016199
2018-08-13 23:32 heilong Note Added: 0016200
2018-08-13 23:53 heilong Note Added: 0016202
2018-08-14 00:03 heilong Note Added: 0016203
2018-08-14 00:03 heilong Note Edited: 0016203 View Revisions
2018-08-14 00:12 DrKnS Note Added: 0016205
2018-08-14 00:23 heilong Note Added: 0016206
2018-08-14 00:48 DrKnS Note Added: 0016207
2018-08-14 13:37 heilong Note Added: 0016208
2018-08-23 12:13 heilong Note Added: 0016223
2018-08-23 12:33 DrKnS Note Added: 0016224
2018-08-23 12:46 heilong Note Added: 0016225
2019-02-22 10:24 JohnDoe Tag Attached: Cmdline Associations