question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow shell selection in local()

See original GitHub issue

Description

According to the Popen docs (see 1st para after 2nd note block) one can force subprocess to use a specific shell instead of the system default (which may vary) by use of the executable kwarg.

First, verify that this is true and works on various platforms.

Then add an analogue to env.shell (probably env.lshell to mirror lcd, or env.local_shell to be nicer looking) allowing optional override of that behavior.

Finally, maybe update local to force use of bash by default so it’s in line with the remote calls. Yes, this will cause it to blow up on bashless systems, but users already encounter this on bashless target systems, and it would avoid issues (such as on Ubuntu) where folks’ user account login shells are bash but subprocess is still using a limited shell like sh (when /bin/sh is not a symlink to /bin/bash).

However, that would technically be a backwards incompatible change, so it comes down to whether we consider people relying on local using sh to be making use of a bug or not.

Would be ideal if we could detect what shell subprocess wants to use and only change this setting if we detect the e.g. Ubuntu setup. OTOH this feels kind of gross and prone to error.


Originally submitted by Jeff Forcier (bitprophet) on 2010-06-14 at 11:28am EDT

Attachments

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bitprophetcommented, May 29, 2018

2.0 now has a shell option in all command-running functions/methods

0reactions
ppawlakcommented, Nov 4, 2014

+1 on fixing this issue. I am on Ubuntu (with /bin/sh pointing to dash) and using virtualenv with fabric doesn’t work. Does anyone have a workaround ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable and Access the Bash Shell from the Appliance Shell
If you want to enable the Bash shell access for other users, run the following command. shell.set --enabled true. To access the ...
Read more >
3.2. Variables
Local variables are only available in the current shell. Using the set built-in command without any options will display a list of all...
Read more >
Use Shell Launcher to create a Windows client kiosk
Go to Control Panel > Programs and features > Turn Windows features on or off. Expand Device Lockdown. Select Shell Launcher and OK....
Read more >
Bash Reference Manual - GNU.org
A shell allows execution of GNU commands, both synchronously and asynchronously. The shell waits for synchronous commands to complete before ...
Read more >
3.1 MySQL Shell Commands
MySQL Shell provides commands which enable you to modify the execution ... If a list of topics is returned, you can select a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found