Backslash with CTRL+[

You have encountered a problem using Far Manager? Here you can get help.
perverez
Posts: 9
Joined: Thu 03 Jul, 2014 11:07

Backslash with CTRL+[

Post by perverez » Thu 10 Oct, 2019 12:38

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).

User avatar
DrKnS
Posts: 5397
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 6 times
Been thanked: 227 times

Backslash with CTRL+[

Post by DrKnS » Thu 10 Oct, 2019 13:41

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.

pepak
Posts: 433
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 6 times
Been thanked: 24 times

Backslash with CTRL+[

Post by pepak » Fri 11 Oct, 2019 05:05

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.

Yegor
Posts: 1029
Joined: Mon 04 Apr, 2005 13:41
Location: San Ramon, CA / Kharkov, UA
Has thanked: 8 times
Been thanked: 19 times

Backslash with CTRL+[

Post by Yegor » Fri 11 Oct, 2019 07:30

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;
}
Last edited by Yegor on Fri 11 Oct, 2019 07:30, edited 1 time in total.
Мы не можем ждать милостей от Фара, взять их у него — наша задача! (C) Мичурин

User avatar
DrKnS
Posts: 5397
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 6 times
Been thanked: 227 times

Backslash with CTRL+[

Post by DrKnS » Fri 11 Oct, 2019 08:32

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

2useven10
Posts: 3965
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 4 times
Been thanked: 168 times

Backslash with CTRL+[

Post by 2useven10 » Fri 11 Oct, 2019 09:43

Yegor wrote:
Fri 11 Oct, 2019 07:30
Here is a simple macro to add a backslash
C:\\

2useven10
Posts: 3965
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 4 times
Been thanked: 168 times

Backslash with CTRL+[

Post by 2useven10 » Fri 11 Oct, 2019 10:00

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.
Last edited by 2useven10 on Fri 11 Oct, 2019 10:52, edited 1 time in total.

User avatar
DrKnS
Posts: 5397
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 6 times
Been thanked: 227 times

Backslash with CTRL+[

Post by DrKnS » Fri 11 Oct, 2019 10:14

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.

pepak
Posts: 433
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 6 times
Been thanked: 24 times

Backslash with CTRL+[

Post by pepak » Fri 11 Oct, 2019 12:05

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.
Last edited by pepak on Fri 11 Oct, 2019 12:08, edited 1 time in total.

pepak
Posts: 433
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 6 times
Been thanked: 24 times

Backslash with CTRL+[

Post by pepak » Fri 11 Oct, 2019 12:13

DrKnS wrote:
Fri 11 Oct, 2019 10:14
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.
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.

User avatar
DrKnS
Posts: 5397
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 6 times
Been thanked: 227 times

Backslash with CTRL+[

Post by DrKnS » Fri 11 Oct, 2019 13:48

So be it.

2useven10
Posts: 3965
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 4 times
Been thanked: 168 times

Backslash with CTRL+[

Post by 2useven10 » Fri 11 Oct, 2019 16:09

A bit more complex macros.
Choose your preference. It should not depends on DrKnS next move(s) or far3 version.
Last edited by 2useven10 on Fri 11 Oct, 2019 20:35, edited 6 times in total.

2useven10
Posts: 3965
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 4 times
Been thanked: 168 times

Backslash with CTRL+[

Post by 2useven10 » Fri 11 Oct, 2019 20:17

Script corrected - Ctrl+Enter added. Default mode for CtrlEnter - NoBackSlash.
Last edited by 2useven10 on Fri 11 Oct, 2019 20:18, edited 1 time in total.

Shmuel
Posts: 5897
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 23 times
Been thanked: 218 times

Backslash with CTRL+[

Post by Shmuel » Fri 11 Oct, 2019 20:29

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

2useven10
Posts: 3965
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 4 times
Been thanked: 168 times

Backslash with CTRL+[

Post by 2useven10 » Fri 11 Oct, 2019 20:38

I have no objections. Link from here to probably moved script will be enough.

Shmuel
Posts: 5897
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 23 times
Been thanked: 218 times

Backslash with CTRL+[

Post by Shmuel » Fri 11 Oct, 2019 20:42

2useven10 wrote:
Fri 11 Oct, 2019 20:38
I have no objections.
Then do it ("Обсуждение макросов" does not require permissions).

Post Reply

Return to “Support and Troubleshooting”