Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/interactive aliases #154

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/dmenu_extended/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def unsatisfied_plugin_requirements(plugin):
"indicator_edit": "*", # Symbol to indicate an item will launch an editor
"indicator_alias": "", # Symbol to indicate an aliased command
"prompt": "Open:", # Prompt
"interactive_shell": False, # Run commands in interactive mode
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the comment, how about "Run commands in an interactive shell session".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 0a30a44 .

}


Expand Down Expand Up @@ -750,7 +751,10 @@ def execute(self, command, fork=None):
print("Command converted into:")
print(command)

return subprocess.call(command)
if self.prefs["interactive_shell"] is True:
shell = os.environ.get("SHELL", "/bin/bash")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than "/bin/bash" how about "/usr/bin/env bash" to handle compatibility with systems that don't have bash under the /bin directory.

Copy link
Contributor Author

@ZappaBoy ZappaBoy Nov 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I perfectly agree with you. Changed in 0a30a44 .

command = shell + " -i -c " + " ".join(command)
return subprocess.call(command, shell=self.prefs["interactive_shell"])

def cache_regenerate(self, message=True):
if message:
Expand Down