Skip to content

Commit

Permalink
Merge branch 'release/0.14.0'
Browse files Browse the repository at this point in the history
Closes issue #43.
  • Loading branch information
markbirbeck committed Feb 13, 2015
2 parents 1186735 + d39ffd2 commit c3d958c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
13 changes: 13 additions & 0 deletions OsShell.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,22 @@ def _process(commands, callback=None, stdin=None, settings=None, working_dir=Non
if bash_env is not None:
command = '. {} && {}'.format(bash_env, command)

# Work out whether the executable is being overridden in the
# configuration settings or an environment variable:
#
# NOTE: We don't need to check COMSPEC on Windows since this
# is already done inside Popen().
#
executable = None
if settings is not None and settings.has('shell-file-name'):
executable = settings.get('shell-file-name')
else:
executable = os.getenv('SHELL')

try:

proc = subprocess.Popen(command,
executable=executable,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ NOTE: Some variable names have hyphens and some underscores. This is because I'm

If comint-scroll-show-maximum-output is `True`, then scrolling due to arrival of output tries to place the last line of text at the bottom line of the window, so as to show as much useful text as possible. (This mimics the scrolling behavior of many terminals.) The default is `False`.

## shell-file-name

`shell-file-name` provides the name of the shell to use when executing commands. If this value is not set then either the `SHELL` or `COMSPEC` environment variable is used, depending on whether Sublime Text is running on a Posix or Windows system. If none of these is set then the behaviour is defined by `subprocess.Popen()`.

## show_success_but_no_output_message

Indicates whether to show a message when the shell command returns no output, or the output is just whitespace. The default value is `False`, i.e., no window is created if the command doesn't return anything.
Expand Down Expand Up @@ -318,6 +322,10 @@ By default long-running commands will update the buffer as and when data is avai

# Changelog

2015-02-13 (v0.14.0)

Added option to allow the shell used to be overridden. Closes issue #32.

2015-02-13 (v0.13.1)

Added option to allow the end of a view to always be visible. Closes issue #39.
Expand Down
12 changes: 11 additions & 1 deletion ShellCommand.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.13.1"
"version": "0.14.0"

/**
* From Emacs: If comint-scroll-show-maximum-output is true, then
Expand All @@ -11,6 +11,16 @@

, "comint-scroll-show-maximum-output": false

/**
* shell-file-name provides the name of the shell to use when
* executing commands. If this value is not set then the SHELL
* environment variable is used on Posix systems, or COMSPEC on
* Windows. If none of these is set then the behaviour is defined
* by subprocess.Popen():
*/

//, "shell-file-name": "bash"

/**
* The default behaviour in Emacs when there is no output from a successful
* shell command, is to show a message in the buffer. We'll make that
Expand Down
3 changes: 2 additions & 1 deletion message.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"0.12.1": "messages/0.12.1.txt",
"0.12.2": "messages/0.12.2.txt",
"0.13.0": "messages/0.13.0.txt",
"0.13.1": "messages/0.13.1.txt"
"0.13.1": "messages/0.13.1.txt",
"0.14.0": "messages/0.14.0.txt"
}
3 changes: 3 additions & 0 deletions messages/0.14.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version 0.14.0 Release Notes

Added shell-file-name which provides the name of the shell to use when executing commands. If this value is not set then either the SHELL or COMSPEC environment variable is used, depending on whether Sublime Text is running on a Posix or Windows system. If none of these is set then the behaviour is defined by subprocess.Popen().

0 comments on commit c3d958c

Please sign in to comment.