Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/14ce6e33e0823b8dff82a66cabfc1f9056bd05b4
>---------------------------------------------------------------
commit 14ce6e33e0823b8dff82a66cabfc1f9056bd05b4
Author: Alex Alabuzhev <
alab...@gmail.com>
Date: Thu Apr 2 20:07:14 2026 +0100
Correction of 1.70.1748 and 3.0.4859
Disk menu, invoked for the passive panel, changes the current directory on the active.
This was partially fixed in 1.70.1748 for AltF1/F2 and in 4858 for the mouse.
However, not for the Main Menu.
The current fix is hopefully final, since it's within the Disk Menu function and not at the call sites.
>---------------------------------------------------------------
14ce6e33e0823b8dff82a66cabfc1f9056bd05b4
far/diskmenu.cpp | 5 +++++
far/filepanels.cpp | 23 +++--------------------
2 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/far/diskmenu.cpp b/far/diskmenu.cpp
index 2759b72d3..b23f344cb 100644
--- a/far/diskmenu.cpp
+++ b/far/diskmenu.cpp
@@ -1493,4 +1493,9 @@ void ChangeDisk(panel_ptr Owner)
Pos = ChangeDiskMenu(Owner, Pos, FirstCall);
FirstCall = false;
}
+
+ // Changing the disk might affect the current directory.
+ // For the active panel it's natural, but for the passive it's not, so we need to set it back.
+ if (!Owner->IsFocused())
+ Owner->Parent()->ActivePanel()->SetCurPath();
}
diff --git a/far/filepanels.cpp b/far/filepanels.cpp
index 5d8ca2f98..fe86f9ec6 100644
--- a/far/filepanels.cpp
+++ b/far/filepanels.cpp
@@ -613,32 +613,17 @@ bool FilePanels::ProcessKey(const Manager::Key& Key)
break;
}
- /* $ 08.04.2002 IS
- При смене диска установим принудительно текущий каталог на активной
- панели, т.к. система не знает ничего о том, что у Фара две панели, и
- текущим для системы после смены диска может быть каталог и на пассивной
- панели
- */
+
case KEY_ALTF1:
case KEY_RALTF1:
- {
ChangeDisk(LeftPanel());
-
- if (!IsLeftActive())
- ActivePanel()->SetCurPath();
-
break;
- }
+
case KEY_ALTF2:
case KEY_RALTF2:
- {
ChangeDisk(RightPanel());
-
- if (!IsRightActive())
- ActivePanel()->SetCurPath();
-
break;
- }
+
case KEY_ALTF7:
case KEY_RALTF7:
{
@@ -1176,8 +1161,6 @@ bool FilePanels::ProcessMouse(const MOUSE_EVENT_RECORD *MouseEvent)
if (!PassivePanel()->ProcessMouse(MouseEvent))
if (!m_windowKeyBar->ProcessMouse(MouseEvent))
CmdLine->ProcessMouse(MouseEvent);
-
- ActivePanel()->SetCurPath();
}
return true;