Commit graph

1873 commits

Author SHA1 Message Date
Gil Forsyth
cce37cde39 make alias expansion a method of built_ins.Aliases
As per suggestions by @scopatz:
* alias expansion function now a method of `built_ins.Aliases`
* flip-flopped function name to fit other methods, now `expand_alias`
* only expand the first token in line
* PEP8 compliant
2015-11-24 12:37:47 -05:00
Gil Forsyth
0332545e8a add alias expansion to completer
Adds a function to expand aliases in the completer to allow completion
for user-defined aliases.

e.g.

aliases['g'] = 'git'
aliases['ck'] = 'checkout'

then 'g ck' TAB will show available branches for checkout.

This is currently restricted to single item aliases.
2015-11-23 17:54:05 -05:00
Anthony Scopatz
9a35c6726e Merge branch 'nicfit-exitcodes' 2015-11-21 22:06:28 -05:00
Anthony Scopatz
12b4b9f845 Merge branch 'exitcodes' of https://github.com/nicfit/xonsh into nicfit-exitcodes 2015-11-21 22:02:57 -05:00
Travis Shirk
c58ec27e0f Ugh, merging brought this back. 2015-11-21 18:43:43 -07:00
Travis Shirk
26e9858dd2 Fixed docstring 2015-11-21 17:58:38 -07:00
Anthony Scopatz
181cd743c6 Merge pull request #520 from bpollack/login-option
Add support for -i and -l options
2015-11-21 19:54:27 -05:00
Benjamin Pollack
533a7e915f Add support for -i and -l options
Support for the login option is very minimal, but the `XONSH_LOGIN`
variable is set in this case so that scripts may take an appropriate
action.

Fixes #517
2015-11-21 18:26:34 -05:00
Anthony Scopatz
a26a4338fb Merge pull request #524 from bpollack/maketestfix
Fix use-before-define error in "make test"
2015-11-21 16:32:32 -05:00
Travis Shirk
63971cd691 Rebased with upstream/master 2015-11-21 14:14:49 -07:00
Benjamin Pollack
48b6abe8a1 Fix use-before-define error in "make test"
In the case that a test was edited, "make test" would erroneously
attempt to add `test_fname` to the list of files to test...which doesn't
exist in that branch. Instead, it should be adding `edited_fname` in
that case.
2015-11-21 16:13:34 -05:00
Travis Shirk
0665e8e1f2 meh, rethink 2015-11-21 13:19:35 -07:00
Travis Shirk
92c91086c7 Signal and exception values reflected in history dicts 2015-11-21 12:36:44 -07:00
Anthony Scopatz
8bd427d7f7 Merge pull request #521 from bpollack/typo_fix
Fix several calls to `eunsure_string`
2015-11-21 13:11:16 -05:00
Benjamin Pollack
7d62d92f26 Fix several calls to eunsure_string 2015-11-21 12:55:44 -05:00
Anthony Scopatz
1402108780 Merge branch 'gforsyth-sudo' 2015-11-20 16:41:29 -05:00
Gil Forsyth
58ffaa7788 add set of skippable tokens
for executables that act on other executables (`sudo`, `time`, etc..)
short-circuit the completer to allow completion on the second executable.
2015-11-20 16:36:28 -05:00
Gil Forsyth
b7710e292e remove comments 2015-11-20 15:48:05 -05:00
Gil Forsyth
6efd0515be enable sudo completion in pt and readline shells
If the command is 'sudo', this short-circuits the completion and just
cuts sudo out of the logic entirely, allowing the completer to act as if
it weren't there.
2015-11-20 15:01:34 -05:00
Anthony Scopatz
be3b5169ef Merge pull request #513 from nicfit/print_color
Helper for printing TERM_COLORS
2015-11-20 11:35:31 -05:00
Anthony Scopatz
a03d04f3ea Merge branch 'nicfit-jobctrl' 2015-11-20 10:42:00 -05:00
Travis Shirk
029ed5ffa7 Fixed 'bg' for Popen 2015-11-19 20:57:31 -07:00
Travis Shirk
d48d45f9eb print_color docstring and 'file' argument 2015-11-19 17:53:11 -07:00
Travis Shirk
2a453b1bbe Don't return None on bogus os.wait code for poll/wait 2015-11-18 20:57:48 -07:00
Travis Shirk
e5aec0c28b Fixed exit codes for TeePTY, and changes the signal info to a 2-tuple (signum, coredump) 2015-11-18 19:36:27 -07:00
Anthony Scopatz
b313c87b6a Merge pull request #510 from selepo/master
bugfix for issue 466 with xonsh.bat installed in non-windows
2015-11-18 15:46:38 -05:00
selepo
f0db5fce77 bugfix 2015-11-18 21:19:23 +01:00
selepo
37a130c775 merge conflict resolved 2015-11-18 20:27:59 +01:00
selepo
ed8b6ce37c bugfix for issue 466 with xonsh.bat installed in non-windows 2015-11-18 18:50:17 +01:00
Travis Shirk
4635e814d0 Reverting Windows change, not sure what to do there. 2015-11-17 21:49:40 -07:00
Travis Shirk
30d4507c71 Changed to os.wait encoding, of course. 2015-11-17 21:28:51 -07:00
Anthony Scopatz
8a51d9e6f4 Merge pull request #506 from krader1961/lint-cleanup
make base_shell lint clean
2015-11-17 10:08:46 -05:00
Kurtis Rader
588a3acd18 make TeeOut and TeeErr private to module 2015-11-17 07:02:07 -08:00
Kurtis Rader
d3a300d801 make base_shell lint clean 2015-11-16 15:36:45 -08:00
Anthony Scopatz
5921c2d6f1 Merge pull request #505 from krader1961/pip-utf8-workaround
accomodate pip bug by making setup.py ascii
2015-11-16 18:20:22 -05:00
Kurtis Rader
95c361aec7 accomodate pip bug by making setup.py ascii
Resolves #487.

Since I was touching this to resolve issue #487 I decided to make it lint
clean as well.
2015-11-16 15:12:02 -08:00
Anthony Scopatz
74c4cb4912 Merge pull request #504 from krader1961/lint-cleanup
add a uniform character encoding to all files
2015-11-16 18:02:41 -05:00
Kurtis Rader
e88c863d10 Add a uniform character encoding to all files.
I wouldn't normally do something like this but issue #487 brought to
my attention the fact that too many of the python modules don't have
an encoding comment and of those that do there is a lot of pointless
inconsistency in the style of the comment.
2015-11-16 14:10:40 -08:00
Anthony Scopatz
a8414ce57c Merge pull request #503 from krader1961/lint-cleanup
Make ast lint clean.
2015-11-16 11:02:47 -05:00
Travis Shirk
de1a2b3b31 Helper for printing TERM_COLORS 2015-11-15 22:36:37 -07:00
Kurtis Rader
c2852ef847 Make ast lint clean. 2015-11-15 20:18:00 -08:00
Anthony Scopatz
4c5387e1bd Merge pull request #500 from krader1961/lint-cleanup
Make history module mostly lint clean.
2015-11-15 22:34:26 -05:00
Anthony Scopatz
bfc316fb58 Merge pull request #492 from krader1961/add-makefile
Add a makefile defining some common tasks.
2015-11-15 22:30:07 -05:00
Anthony Scopatz
ca5974ba26 Merge branch 'ptwin' 2015-11-15 22:27:34 -05:00
Travis Shirk
ca7870a6ce Fixed by removing test program remnants 2015-11-15 19:04:21 -07:00
Kurtis Rader
23187e2044 clarify how to test incl. locally installed code 2015-11-15 18:02:51 -08:00
Travis Shirk
050d0bbfd2 Captures correct process exit codes or signal info. 2015-11-15 18:55:02 -07:00
Kurtis Rader
f16268e108 don't instantiate history cmd parser at startup
We want to avoid doing anything at startup that can be deferred. So instead of
creating the history command parser on module import memoize the function.
2015-11-15 17:40:14 -08:00
Anthony Scopatz
6c4b8937e5 Merge pull request #495 from gforsyth/vi_mode_config
allow user to enable vi_mode in prompt_toolkit
2015-11-15 10:27:07 -05:00
Gil Forsyth
8ed96da1f4 fix teardown bug
I'm not completely sure of the mechanism, but by assigning the value of
`builtins.__xonsh_env__.get('VI_MODE')` to an instance attribute the PT
history teardown routine throws an error on exit.

Instead, just feed the True/False value from the `.get()` directly to
the lambda function that runs the vi_mode keybinding.  Everything still
works as expected and no errors on exit.
2015-11-15 10:18:45 -05:00