Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: bootstrap/win/profile.d.python.sh

Issue 1851113003: Add bash shell function to make python work like it should. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: add comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | bootstrap/win/win_tools.bat » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2 # This alias allows invocations of `python` to work as expected under msys bash.
3 # In particular, it detects if stdout+stdin are both attached to a pseudo-tty,
4 # and if so, invokes python in interactive mode. If this is not the case, or
5 # the user passes any arguments, python will be invoked unmodified.
6 python() {
7 if [[ $# > 0 ]]; then
8 python.exe "$@"
9 else
10 readlink /proc/$$/fd/0 | grep pty > /dev/null
11 TTY0=$?
12 readlink /proc/$$/fd/1 | grep pty > /dev/null
13 TTY1=$?
14 if [ $TTY0 == 0 ] && [ $TTY1 == 0 ]; then
15 python.exe -i
16 else
17 python.exe
18 fi
19 fi
20 }
OLDNEW
« no previous file with comments | « no previous file | bootstrap/win/win_tools.bat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698