##// END OF EJS Templates
sh profile uses 'cygwin in path' to determine ls --color=auto alias and whether to load ipy_fsops.py
vivainio -
Show More
@@ -36,7 +36,6 b' def main():'
36 36 import ipy_rehashdir
37 37 import ipy_signals
38 38
39
40 39 ip.ex('import os')
41 40 ip.ex("def up(): os.chdir('..')")
42 41
@@ -52,14 +51,10 b' def main():'
52 51 # I like my banner minimal.
53 52 o.banner = "IPython %s [on Py %s]\n" % (Release.version,sys.version.split(None,1)[0])
54 53
55 # make 'd' an alias for ls -F
56
57 # ip.magic('alias d ls -F --color=auto')
58 54
59 55 ip.IP.default_option('cd','-q')
60 56
61 57 # If you only rarely want to execute the things you %edit...
62
63 58 #ip.IP.default_option('edit','-x')
64 59
65 60
@@ -83,7 +78,7 b' def main():'
83 78 ip.magic('rehashx')
84 79 syscmds = db.get("syscmdlist")
85 80
86 # locase aliases on win#2 only
81 # lowcase aliases on win32 only
87 82 if os.name == 'posix':
88 83 mapper = lambda s:s
89 84 else:
@@ -96,12 +91,21 b' def main():'
96 91 if key not in ip.IP.alias_table:
97 92 ip.defalias(key, cmd)
98 93
99 if 'ls' in syscmds:
100 # use the colors of cygwin ls (recommended)
101 ip.magic('alias d ls -F --color=auto')
102 94 # mglob combines 'find', recursion, exclusion... '%mglob?' to learn more
103 95 ip.load("IPython.external.mglob")
104 96
97 # win32 is crippled w/o cygwin, try to help it a little bit
98 if sys.platform == 'win32':
99 if 'cygwin' in os.environ['PATH'].lower():
100 # use the colors of cygwin ls (recommended)
101 ip.defalias('d', 'ls -F --color=auto')
102 else:
103 # get icp, imv, imkdir, igrep, irm,...
104 ip.load('ipy_fsops')
105
106 # and the next best thing to real 'ls -F'
107 ip.defalias('d','dir /w /og /on')
108
105 109 extend_shell_behavior(ip)
106 110
107 111 # XXX You do not need to understand the next function!
@@ -4,13 +4,17 b''
4 4 of ['dirname/foo','dirname/bar', ...].
5 5
6 6 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
7 win32 installations: icp, imv, imkdir, igrep, collect (collect
7 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
8 8 is useful for others as well).
9 9
10 10 * iplib.py: on callable aliases (as opposed to old style aliases),
11 11 do var_expand() immediately, and use make_quoted_expr instead
12 12 of hardcoded r"""
13 13
14 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
15 if not available load ipy_fsops.py for cp, mv, etc. replacements
16
17
14 18 2007-09-04 Ville Vainio <vivainio@gmail.com>
15 19
16 20 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
General Comments 0
You need to be logged in to leave comments. Login now