summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/shared/text-buffer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/components/shared/text-buffer.ts')
-rw-r--r--packages/cli/src/ui/components/shared/text-buffer.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/cli/src/ui/components/shared/text-buffer.ts b/packages/cli/src/ui/components/shared/text-buffer.ts
index 0283e059..4b7c3e79 100644
--- a/packages/cli/src/ui/components/shared/text-buffer.ts
+++ b/packages/cli/src/ui/components/shared/text-buffer.ts
@@ -73,6 +73,7 @@ interface UseTextBufferProps {
setRawMode?: (mode: boolean) => void; // For external editor
onChange?: (text: string) => void; // Callback for when text changes
isValidPath: (path: string) => boolean;
+ shellModeActive?: boolean; // Whether the text buffer is in shell mode
}
interface UndoHistoryEntry {
@@ -960,6 +961,7 @@ export function useTextBuffer({
setRawMode,
onChange,
isValidPath,
+ shellModeActive = false,
}: UseTextBufferProps): TextBuffer {
const initialState = useMemo((): TextBufferState => {
const lines = initialText.split('\n');
@@ -1028,7 +1030,7 @@ export function useTextBuffer({
}
const minLengthToInferAsDragDrop = 3;
- if (ch.length >= minLengthToInferAsDragDrop) {
+ if (ch.length >= minLengthToInferAsDragDrop && !shellModeActive) {
let potentialPath = ch;
if (
potentialPath.length > 2 &&
@@ -1060,7 +1062,7 @@ export function useTextBuffer({
dispatch({ type: 'insert', payload: currentText });
}
},
- [isValidPath],
+ [isValidPath, shellModeActive],
);
const newline = useCallback((): void => {