diff --git a/apps/mintty/mintty_win.py b/apps/mintty/mintty_win.py index 783a30a860..495d32053b 100644 --- a/apps/mintty/mintty_win.py +++ b/apps/mintty/mintty_win.py @@ -1,4 +1,5 @@ import subprocess +from typing import Optional from talon import Context, Module, actions, settings, ui @@ -113,8 +114,8 @@ def file_manager_open_volume(volume: str): """file_manager_open_volume""" actions.user.file_manager_open_directory(volume) - def terminal_list_directories(): - actions.insert("ls") + def terminal_list_directories(path: Optional[str] = None): + actions.insert(f"ls {path or ''}") actions.key("enter") def terminal_list_all_directories(): diff --git a/apps/windows_command_processor/command_processor_win.py b/apps/windows_command_processor/command_processor_win.py index 389178ce11..8a42980d1c 100644 --- a/apps/windows_command_processor/command_processor_win.py +++ b/apps/windows_command_processor/command_processor_win.py @@ -1,4 +1,5 @@ import os +from typing import Optional from talon import Context, actions, ui @@ -79,9 +80,9 @@ def file_manager_open_volume(volume: str): """file_manager_open_volume""" actions.user.file_manager_open_directory(volume) - def terminal_list_directories(): + def terminal_list_directories(path: Optional[str] = None): """Lists directories""" - actions.insert("dir") + actions.insert(f"dir {path or ''}") actions.key("enter") def terminal_list_all_directories(): diff --git a/apps/wsl/wsl.py b/apps/wsl/wsl.py index ebc3ac7da7..18c8a6b2f0 100644 --- a/apps/wsl/wsl.py +++ b/apps/wsl/wsl.py @@ -3,6 +3,7 @@ import re import subprocess import sys +from typing import Optional from talon import Context, Module, actions, app, ui from talon.debug import log_exception @@ -475,8 +476,8 @@ def file_manager_select_file(path: str): def file_manager_open_volume(volume: str): actions.user.file_manager_open_directory(volume) - def terminal_list_directories(): - actions.insert("ls") + def terminal_list_directories(path: Optional[str] = None): + actions.insert(f"ls {path or ''}") actions.key("enter") def terminal_list_all_directories(): diff --git a/pyproject.toml b/pyproject.toml index e6b9a2ef2f..5623ccd904 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,3 +12,4 @@ pythonpath = [ [tool.pyright] reportSelfClsParameterName = false +reportGeneralTypeIssues = false diff --git a/tags/terminal/terminal.py b/tags/terminal/terminal.py index 3d5b6e7813..0c846466d1 100644 --- a/tags/terminal/terminal.py +++ b/tags/terminal/terminal.py @@ -1,3 +1,5 @@ +from typing import Optional + from talon import Module mod = Module() @@ -5,7 +7,7 @@ @mod.action_class class Actions: - def terminal_list_directories(): + def terminal_list_directories(path: Optional[str] = None): """Lists directories""" def terminal_list_all_directories(): diff --git a/tags/terminal/terminal.talon b/tags/terminal/terminal.talon index 6d6b6f4ec5..072e231fca 100644 --- a/tags/terminal/terminal.talon +++ b/tags/terminal/terminal.talon @@ -2,7 +2,7 @@ tag: terminal - # tags should be activated for each specific terminal in the respective talon file -lisa: user.terminal_list_directories() +lisa [dir] []: user.terminal_list_directories(text or "") lisa all: user.terminal_list_all_directories() katie [dir] []: user.terminal_change_directory(text or "") katie root: user.terminal_change_directory_root() diff --git a/tags/terminal/unix_shell.py b/tags/terminal/unix_shell.py index 07f30edcca..ba271d212c 100644 --- a/tags/terminal/unix_shell.py +++ b/tags/terminal/unix_shell.py @@ -1,3 +1,5 @@ +from typing import Optional + from talon import Context, Module, actions ctx = Context() @@ -14,9 +16,8 @@ class Actions: # Implements the functions from terminal.py for unix shells - def terminal_list_directories(): - """Lists directories""" - actions.insert("ls") + def terminal_list_directories(path: Optional[str] = None): + actions.insert(f"ls {path or ''}") actions.key("enter") def terminal_list_all_directories(): diff --git a/tags/terminal/windows_shell.py b/tags/terminal/windows_shell.py index 69b39972cd..6d2ef5e63f 100644 --- a/tags/terminal/windows_shell.py +++ b/tags/terminal/windows_shell.py @@ -1,3 +1,5 @@ +from typing import Optional + from talon import Context, Module, actions ctx = Context() @@ -9,11 +11,10 @@ @ctx.action_class("user") class Actions: - # Implements the functions from terminal.py for unix shells + # Implements the functions from terminal.py for PowerShell - def terminal_list_directories(): - """Lists directories""" - actions.insert("ls") + def terminal_list_directories(path: Optional[str] = None): + actions.insert(f"ls {path or ''}") actions.key("enter") def terminal_list_all_directories():