Page 1 of 2

Backslash with CTRL+[

Posted: Thu 10 Oct, 2019 12:38
by perverez
Hi, build 5485 does not end the path with '\' when I inserting path and filename. In previous version I use hot key CTRL+[ and then CTRL+Enter for inserting full filename (e.g. when I comparing two files - fc somefile.txt X:\Example\somefile.txt), but now if filename bad (fc somefile.txt X:\Examplesomefile.txt).

Backslash with CTRL+[

Posted: Thu 10 Oct, 2019 13:41
by DrKnS
Hi, there were reports that paths like "c:\something\" (note the quotes) don't work properly when passed to other programs (due to weird escaping rules), so we put the backslash outside the quotes, e.g. "c:\something"\. And then there were other reports that this doesn't work as well in some other stupid programs that can't unquote properly. So we were like "A plague o' both your houses!" and removed the backslash completely. You can write a simple macro to put a trailing backslash wherever you prefer.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 05:05
by pepak
Personally, I find the original behavior (before 5472) the best suited for my needs and recompile FAR with that commit removed. And would urge to recommend the return to the original functionality for the official FAR itself - after all, if someone finds the terminating backslash interfering with their "some other stupid programs", they can always write a macro to remove it, there's no need to force a change onto those who don't have this problem.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 07:30
by Yegor
Here is a simple macro to add a backslash (silly):

Code: Select all

Macro {
  area="Shell";
  key="Ctrl[ Ctrl]"; 
  description="Backslash with Ctrl+[ ]";
  action = function()
    key = mf.key(akey(1));
    
    if (key == "Ctrl[" and APanel.Left) or (key == "Ctrl]" and not APanel.Left) then
      mf.print("\""..APanel.Path.."\\\"");
    else  
      mf.print("\""..PPanel.Path.."\\\"");
    end
  end;
}
or even a sillier one:

Code: Select all

Macro {
  area="Shell";
  key="Ctrl[ Ctrl]"; 
  description="Backslash with Ctrl+[ ]";
  action = function()
    Keys("AKey \\")
  end;
}

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 08:32
by DrKnS
pepak wrote: Fri 11 Oct, 2019 05:05the original behavior (before 5472)
The "original" behaviour was before 4521.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 09:43
by 2useven10
Yegor wrote: Fri 11 Oct, 2019 07:30 Here is a simple macro to add a backslash
C:\\

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 10:00
by 2useven10
Also missed keys Ctrl+Shift Ctrl+Alt Alt+Shift + [ ]
Would be nice if both variants possible: before 5472 and before 4521.
If macros can handle all mentioned cases add it in Addons will cover all wishes.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 10:14
by DrKnS
I'm pondering about reverting to the original behaviour (pre-4521, backslash-within-quotes, "path\").
After all, it was there for 20 years and didn't cause much trouble.
I remember only 1 (one) report when it wasn't desirable - https://bugs.farmanager.com/view.php?id=3011.
Changing it literally opened a can of worms.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 12:05
by pepak
Seems like a value in far:config might be in order...

Myself, I don't really care where the backslash is, as long as it is somewhere. Both pre-5472 and pre-4521 work fine for me. Post-5472 is unusable as far as I am concerned, even with a macro (which seems to be growing to absurd proportions if it needs to recover all the functionality). But as I re-build FAR from the sources anyway, to facilitate my improvements which are not being accepted to the main source, it makes little difference to me whether there is an option or not.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 12:13
by pepak
DrKnS wrote: Fri 11 Oct, 2019 10:14I remember only 1 (one) report when it wasn't desirable - https://bugs.farmanager.com/view.php?id=3011.
Changing it literally opened a can of worms.
Looking at the report, I would say that it actually reported something which is an error in the user's application rather than FAR: A quote belongs to the set of characters prohibited from appearing in filenames (source) and as such the application should not allow a quote to become a part of a filename. If escaping is required by the application (to facilitate passing an argument to another application, for example), it should be done consistently and not by interpreting \" as an escaped " but \C as unescaped \C. I am all for reverting the change completely.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 13:48
by DrKnS
So be it.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 16:09
by 2useven10
A bit more complex macros.
Choose your preference. It should not depends on DrKnS next move(s) or far3 version.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 20:17
by 2useven10
Script corrected - Ctrl+Enter added. Default mode for CtrlEnter - NoBackSlash.

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 20:29
by Shmuel
2useven10 wrote: Fri 11 Oct, 2019 20:17 Script corrected
Maybe it's worth to place it as a separate topic in "Обсуждение макросов"?

Backslash with CTRL+[

Posted: Fri 11 Oct, 2019 20:38
by 2useven10
I have no objections. Link from here to probably moved script will be enough.