From e21f0f9875eeca1bb5a539ed9080c3ae6e187810 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Wed, 25 Feb 2026 04:57:39 +0530 Subject: [PATCH 1/4] Fix: Change copy filepath shortcut from CTRL+Q to CTRL+Y for macOS compatibility (Fixes #617) --- datashuttle/tui/app.py | 2 +- datashuttle/tui/custom_widgets.py | 5 +++-- datashuttle/tui/tooltips.py | 4 ++-- docs/source/pages/get_started/getting-started.md | 4 ++-- docs/source/pages/user_guides/create-folders.md | 2 +- tests/tests_tui/test_tui_directorytree.py | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/datashuttle/tui/app.py b/datashuttle/tui/app.py index bac7594d9..c985b405e 100644 --- a/datashuttle/tui/app.py +++ b/datashuttle/tui/app.py @@ -120,7 +120,7 @@ def on_button_pressed(self, event: Button.Pressed) -> None: def action_show_copy_help(self) -> None: """Display a notification (for CTRL+C).""" self.notify( - "Use CTRL+Q to copy from Inputs and DirectoryTrees.\n" + "Use CTRL+Y to copy from Inputs and DirectoryTrees.\n" "Use ESC or the 'Exit' button to quit the application.\n" "CTRL+C can be used to copy after highlighting text with the mouse while pressing 'shift'.", timeout=6, diff --git a/datashuttle/tui/custom_widgets.py b/datashuttle/tui/custom_widgets.py index 1ee24308b..7ee967b1b 100644 --- a/datashuttle/tui/custom_widgets.py +++ b/datashuttle/tui/custom_widgets.py @@ -100,7 +100,7 @@ def as_names_list(self) -> List[str]: def on_key(self, event: events.Key) -> None: """Handle keyboard press on the Input.""" - if event.key == "ctrl+q": + if event.key == "ctrl+y": self.mainwindow.copy_to_clipboard(self.value) elif event.key == "ctrl+o": @@ -157,6 +157,7 @@ def on_mouse_move(self, event: MouseMove) -> None: if not self.has_focus: # type: ignore self.focus() + def filter_paths(self, paths: Iterable[Path]) -> Iterable[Path]: """Filter out all hidden folders and files from CustomDirectoryTree display. @@ -184,7 +185,7 @@ def on_key(self, event: events.Key) -> None: Textual event containing information on the key press. """ - if event.key == "ctrl+q": + if event.key == "ctrl+y": path_ = self.get_node_at_line(self.hover_line).data.path path_str = path_.as_posix() self.mainwindow.copy_to_clipboard(path_str) diff --git a/datashuttle/tui/tooltips.py b/datashuttle/tui/tooltips.py index 6d0e63a5a..45cd98652 100644 --- a/datashuttle/tui/tooltips.py +++ b/datashuttle/tui/tooltips.py @@ -130,7 +130,7 @@ def get_tooltip(id: str) -> str: "when hovering the mouse over a folder:\n\n" "-CTRL+O : open the folder in the system filebrowser.\n" "-CTRL+N : rename a file or folder.\n" - "-CTRL+Q : copy the full filepath to clipboard.\n" + "-CTRL+Y : copy the full filepath to clipboard.\n" "-CTRL+R : refresh the folder tree.\n" "-CTRL+F : fill the 'sub-' or 'ses-' input with the foldername.\n" "-CTRL+A : similar to CTRL+F, but append." @@ -206,7 +206,7 @@ def get_tooltip(id: str) -> str: "Keyboard shortcuts, when hovering the mouse over a folder:\n\n" "-CTRL+O : open the folder in the system filebrowser.\n" "-CTRL+N : rename a file or folder.\n" - "-CTRL+Q : copy the full filepath to clipboard.\n" + "-CTRL+Y : copy the full filepath to clipboard.\n" "-CTRL+R : refresh the folder tree.\n" "-CTRL+F : fill the 'sub-' or 'ses-' input with the foldername.\n" "-CTRL+A : similar to CTRL+F, but append." diff --git a/docs/source/pages/get_started/getting-started.md b/docs/source/pages/get_started/getting-started.md index 5751c149a..e7526cfa9 100644 --- a/docs/source/pages/get_started/getting-started.md +++ b/docs/source/pages/get_started/getting-started.md @@ -163,7 +163,7 @@ if connecting via SSH. In this tutorial, we will set this next to the local path for convenience. -1) Copy the contents of the _local path_ input by clicking it, hovering over it and pressing `CTRL+Q` to copy. +1) Copy the contents of the _local path_ input by clicking it, hovering over it and pressing `CTRL+Y` to copy. 2) Paste it into the _central path_ input with `CTRL+V` and change "local" to "central". ```{image} /_static/screenshots/tutorial-1-make-central-path-dark.png @@ -416,7 +416,7 @@ will update to display the new folders:
By hovering over a folder with the mouse we can quickly -copy the full path to the folder by pressing `CTRL+Q)` +copy the full path to the folder by pressing `CTRL+Y)` (you may need to click the `Directory Tree` first). Alternatively, pressing `CTRL+O` will open the folder in your file browser. diff --git a/docs/source/pages/user_guides/create-folders.md b/docs/source/pages/user_guides/create-folders.md index 0de86c58f..5c1a6034c 100644 --- a/docs/source/pages/user_guides/create-folders.md +++ b/docs/source/pages/user_guides/create-folders.md @@ -112,7 +112,7 @@ Open folder in system filebrowser : `CTRL+O` will open a folder in the system filebrowser. Copy the full filepath. -: `CTRL+Q` will copy the entire filepath of the file or +: `CTRL+Y` will copy the entire filepath of the file or folder. \ diff --git a/tests/tests_tui/test_tui_directorytree.py b/tests/tests_tui/test_tui_directorytree.py index 6b4d2d79c..3371b1b17 100644 --- a/tests/tests_tui/test_tui_directorytree.py +++ b/tests/tests_tui/test_tui_directorytree.py @@ -134,7 +134,7 @@ async def test_create_folders_directorytree_clipboard( pilot, "#create_folders_directorytree", hover_line=2, - press_string="ctrl+q", + press_string="ctrl+y", ) pasted_path = pyperclip.paste() @@ -178,7 +178,7 @@ def mock_copy(_): pilot, "#create_folders_directorytree", hover_line=2, - press_string="ctrl+q", + press_string="ctrl+y", ) # Check that the error message is displayed. From 852b06bc7adb7bcfc42ccfd046f803fcacd83c6e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 23:30:34 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- datashuttle/tui/custom_widgets.py | 1 - 1 file changed, 1 deletion(-) diff --git a/datashuttle/tui/custom_widgets.py b/datashuttle/tui/custom_widgets.py index 7ee967b1b..346eb9e6c 100644 --- a/datashuttle/tui/custom_widgets.py +++ b/datashuttle/tui/custom_widgets.py @@ -157,7 +157,6 @@ def on_mouse_move(self, event: MouseMove) -> None: if not self.has_focus: # type: ignore self.focus() - def filter_paths(self, paths: Iterable[Path]) -> Iterable[Path]: """Filter out all hidden folders and files from CustomDirectoryTree display. From 5a680deea9f563527e2a8d7a04b6d9d132cc8a96 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sat, 28 Feb 2026 09:37:50 +0530 Subject: [PATCH 3/4] fix: use ctrl+c to copy filepath, remove redundant copy help notification --- datashuttle/tui/app.py | 7 ------- datashuttle/tui/custom_widgets.py | 4 ++-- datashuttle/tui/tooltips.py | 4 ++-- tests/tests_tui/test_tui_directorytree.py | 4 ++-- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/datashuttle/tui/app.py b/datashuttle/tui/app.py index c985b405e..d7db9eaa2 100644 --- a/datashuttle/tui/app.py +++ b/datashuttle/tui/app.py @@ -43,7 +43,6 @@ class TuiApp(App, inherit_bindings=False): # type: ignore BINDINGS = [ Binding("escape", "exit_app", "Exit app", priority=True), - Binding("ctrl+c", "show_copy_help", "Show copy help", priority=True), ] exit_accept_or_decline_popup = False @@ -117,12 +116,6 @@ def on_button_pressed(self, event: Button.Pressed) -> None: elif event.button.id == "mainwindow_exit_button": self.app.exit() - def action_show_copy_help(self) -> None: - """Display a notification (for CTRL+C).""" - self.notify( - "Use CTRL+Y to copy from Inputs and DirectoryTrees.\n" - "Use ESC or the 'Exit' button to quit the application.\n" - "CTRL+C can be used to copy after highlighting text with the mouse while pressing 'shift'.", timeout=6, ) diff --git a/datashuttle/tui/custom_widgets.py b/datashuttle/tui/custom_widgets.py index 346eb9e6c..bc60744a7 100644 --- a/datashuttle/tui/custom_widgets.py +++ b/datashuttle/tui/custom_widgets.py @@ -100,7 +100,7 @@ def as_names_list(self) -> List[str]: def on_key(self, event: events.Key) -> None: """Handle keyboard press on the Input.""" - if event.key == "ctrl+y": + if event.key == "ctrl+c": self.mainwindow.copy_to_clipboard(self.value) elif event.key == "ctrl+o": @@ -184,7 +184,7 @@ def on_key(self, event: events.Key) -> None: Textual event containing information on the key press. """ - if event.key == "ctrl+y": + if event.key == "ctrl+c": path_ = self.get_node_at_line(self.hover_line).data.path path_str = path_.as_posix() self.mainwindow.copy_to_clipboard(path_str) diff --git a/datashuttle/tui/tooltips.py b/datashuttle/tui/tooltips.py index 45cd98652..80787be81 100644 --- a/datashuttle/tui/tooltips.py +++ b/datashuttle/tui/tooltips.py @@ -130,7 +130,7 @@ def get_tooltip(id: str) -> str: "when hovering the mouse over a folder:\n\n" "-CTRL+O : open the folder in the system filebrowser.\n" "-CTRL+N : rename a file or folder.\n" - "-CTRL+Y : copy the full filepath to clipboard.\n" + "-CTRL+C : copy the full filepath to clipboard.\n" "-CTRL+R : refresh the folder tree.\n" "-CTRL+F : fill the 'sub-' or 'ses-' input with the foldername.\n" "-CTRL+A : similar to CTRL+F, but append." @@ -206,7 +206,7 @@ def get_tooltip(id: str) -> str: "Keyboard shortcuts, when hovering the mouse over a folder:\n\n" "-CTRL+O : open the folder in the system filebrowser.\n" "-CTRL+N : rename a file or folder.\n" - "-CTRL+Y : copy the full filepath to clipboard.\n" + "-CTRL+C : copy the full filepath to clipboard.\n" "-CTRL+R : refresh the folder tree.\n" "-CTRL+F : fill the 'sub-' or 'ses-' input with the foldername.\n" "-CTRL+A : similar to CTRL+F, but append." diff --git a/tests/tests_tui/test_tui_directorytree.py b/tests/tests_tui/test_tui_directorytree.py index 3371b1b17..cc9e811f8 100644 --- a/tests/tests_tui/test_tui_directorytree.py +++ b/tests/tests_tui/test_tui_directorytree.py @@ -134,7 +134,7 @@ async def test_create_folders_directorytree_clipboard( pilot, "#create_folders_directorytree", hover_line=2, - press_string="ctrl+y", + press_string="ctrl+c", ) pasted_path = pyperclip.paste() @@ -178,7 +178,7 @@ def mock_copy(_): pilot, "#create_folders_directorytree", hover_line=2, - press_string="ctrl+y", + press_string="ctrl+c", ) # Check that the error message is displayed. From 7a980614817240923432ce946fe03aaf1a76c7c4 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sat, 28 Feb 2026 09:47:34 +0530 Subject: [PATCH 4/4] fix: properly remove ctrl+c binding and show_copy_help action --- datashuttle/tui/app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/datashuttle/tui/app.py b/datashuttle/tui/app.py index d7db9eaa2..1d6ec3079 100644 --- a/datashuttle/tui/app.py +++ b/datashuttle/tui/app.py @@ -116,6 +116,12 @@ def on_button_pressed(self, event: Button.Pressed) -> None: elif event.button.id == "mainwindow_exit_button": self.app.exit() + def action_show_copy_help(self) -> None: + """Display a notification (for CTRL+C).""" + self.notify( + "Use CTRL+Y to copy from Inputs and DirectoryTrees.\n" + "Use ESC or the 'Exit' button to quit the application.\n" + "CTRL+C can be used to copy after highlighting text with the mouse while pressing 'shift'.", timeout=6, )