diff --git a/IPython/Extensions/ipy_profile_sh.py b/IPython/Extensions/ipy_profile_sh.py index c25afef..ef4ae8e 100644 --- a/IPython/Extensions/ipy_profile_sh.py +++ b/IPython/Extensions/ipy_profile_sh.py @@ -117,6 +117,7 @@ def main(): # and the next best thing to real 'ls -F' ip.defalias('d','dir /w /og /on') + ip.set_hook('input_prefilter', dotslash_prefilter_f) extend_shell_behavior(ip) class LastArgFinder: @@ -138,9 +139,15 @@ class LastArgFinder: return parts[-1] return "" - - - +def dotslash_prefilter_f(self,line): + """ ./foo now runs foo as system command + + Removes the need for doing !./foo + """ + import IPython.genutils + if line.startswith("./"): + return "_ip.system(" + IPython.genutils.make_quoted_expr(line)+")" + raise ipapi.TryNext # XXX You do not need to understand the next function! # This should probably be moved out of profile diff --git a/IPython/UserConfig/ipy_user_conf.py b/IPython/UserConfig/ipy_user_conf.py index 2500a18..b0184ef 100644 --- a/IPython/UserConfig/ipy_user_conf.py +++ b/IPython/UserConfig/ipy_user_conf.py @@ -92,6 +92,15 @@ def main(): # at your own risk! #import ipy_greedycompleter + # If you are on Linux, you may be annoyed by + # "Display all N possibilities? (y or n)" on tab completion, + # as well as the paging through "more". Uncomment the following + # lines to disable that behaviour + #import readline + #readline.parse_and_bind('set completion-query-items 1000') + #readline.parse_and_bind('set page-completions no') + + # some config helper functions you can use diff --git a/docs/source/changes.txt b/docs/source/changes.txt index 85d3b83..d10ced7 100644 --- a/docs/source/changes.txt +++ b/docs/source/changes.txt @@ -29,6 +29,7 @@ New features Development Team" as the copyright holder. We give more details about exactly what this means in this file. All developer should read this and use the new banner in all IPython source code files. + * sh profile: ./foo runs foo as system command, no need to do !./foo anymore Bug fixes ---------