mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 21:03:47 +00:00
feat: add Open File Manager to tab right-click menu (#1051)
Co-authored-by: SankeerthNara <sankeerthnara@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
Pencil,
|
||||
Maximize2,
|
||||
Minimize2,
|
||||
FolderOpen,
|
||||
} from "lucide-react";
|
||||
import { tabIcon } from "@/shell/tabUtils";
|
||||
import { isElectron } from "@/lib/electron";
|
||||
@@ -40,6 +41,7 @@ export function TabBar({
|
||||
onAddToSplit,
|
||||
onRemoveFromSplit,
|
||||
onRenameTab,
|
||||
onOpenFileManager,
|
||||
isAppFullscreen,
|
||||
onToggleAppFullscreen,
|
||||
}: {
|
||||
@@ -56,6 +58,7 @@ export function TabBar({
|
||||
onAddToSplit: (tabId: string) => void;
|
||||
onRemoveFromSplit: (tabId: string) => void;
|
||||
onRenameTab?: (tabId: string, newLabel: string) => void;
|
||||
onOpenFileManager?: (tabId: string) => void;
|
||||
isAppFullscreen: boolean;
|
||||
onToggleAppFullscreen: () => void;
|
||||
}) {
|
||||
@@ -527,6 +530,20 @@ export function TabBar({
|
||||
{t("nav.refreshTab")}
|
||||
</button>
|
||||
)}
|
||||
{ctxTab.type === "terminal" &&
|
||||
ctxTab.host &&
|
||||
onOpenFileManager && (
|
||||
<button
|
||||
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-left hover:bg-accent hover:text-accent-foreground"
|
||||
onClick={() => {
|
||||
onOpenFileManager(contextTabId);
|
||||
setContextTabId(null);
|
||||
}}
|
||||
>
|
||||
<FolderOpen className="size-3" />
|
||||
{t("nav.openFileManager")}
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-left hover:bg-accent hover:text-accent-foreground"
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user