Test mode support in fish

WARNING: Requires development version of fish. Since fish is not tested in
travis it is probably OK.
This commit is contained in:
ZyX 2014-08-24 17:09:40 +04:00
parent 54672aace0
commit 0af5e2d2ca
3 changed files with 30 additions and 4 deletions

View File

@ -14,3 +14,22 @@
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  (echo)  
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  $(echo)  
  HOSTNAME  USER   BRANCH  ⋯  shell  3rd  `echo`  
 USER  ⋯  shell  3rd  `echo`  
   BRANCH 
   BRANCH 
   BRANCH 
 INSERT  USER  ⋯  shell  3rd  `echo`  
   BRANCH 
 DEFAULT  USER  ⋯  shell  3rd  `echo`  
   BRANCH 
 INSERT  USER  ⋯  shell  3rd  `echo`  
   BRANCH 
 DEFAULT  USER  ⋯  shell  3rd  `echo`  
   BRANCH 
 INSERT  USER  ⋯  shell  3rd  `echo`  
   BRANCH 
   BRANCH 
 INSERT  USER  ⋯  shell  3rd  `echo`  
   BRANCH 
   BRANCH 
   BRANCH 

View File

@ -23,6 +23,9 @@ cd ../'#[bold]'
cd ../'(echo)'
cd ../'$(echo)'
cd ../'`echo`'
set POWERLINE_COMMAND "$POWERLINE_COMMAND -c ext.shell.theme=default"
set -g fish_key_bindings fish_vi_key_bindings
ii
false
true is the last line
exit

View File

@ -41,12 +41,16 @@ with codecs.open(fname, 'r', encoding='utf-8') as R:
if pid is not None:
line = line.replace(pid, 'PID')
if shell == 'fish':
res = ''
try:
start = line.index('\033[0;')
end = line.index('\033[0m', start)
line = line[start:end + 4] + '\n'
while line.index('\033[0;'):
start = line.index('\033[0;')
end = line.index('\033[0m', start)
res += line[start:end + 4] + '\n'
line = line[end + 4:]
except ValueError:
line = ''
pass
line = res
elif shell == 'tcsh':
try:
start = line.index('\033[0;')