Skip to content

Commit

Permalink
Adding tab completion for tcsh on conda activation (#3244)
Browse files Browse the repository at this point in the history
  • Loading branch information
SgStapleton authored and jessemapel committed Apr 25, 2019
1 parent 187e70e commit 71d266b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions isis/scripts/isis3VarInit.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def mkdir( p ):
setenv ISISROOT {}
setenv ISIS3DATA {}
setenv ISIS3TESTDATA {}
source $CONDA_PREFIX/scripts/tabCompletion.csh
""".format(os.environ['CONDA_PREFIX'], args.data_dir, args.test_dir)
a.write(script)
print( 'Wrote '+activate_vars_csh )
Expand Down
25 changes: 25 additions & 0 deletions isis/scripts/tabCompletion.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/csh


# Setup tab completion
if ( -f $ISISROOT/bin/isiscomplete ) then
set newBinaries = `/bin/ls $ISISROOT/bin/xml | grep -v qt.conf | sed s%\.xml%%`
set i = 0
set loop = 0
set chunk = ""
foreach app ($newBinaries)
@ i = $i + 1
@ loop = $loop + 1
set chunk = "$chunk $app"
if ( "$i" == 100 || "$loop" == $#newBinaries) then
eval `$ISISROOT/bin/isiscomplete $chunk`
set i = 1
set chunk = ""
endif
end
unset i
unset loop
unset chunk
unset app
unset newBinaries
endif

0 comments on commit 71d266b

Please sign in to comment.