##// END OF EJS Templates
Fix bugs in calling cwd_filt and cwd_filt2 for prompts.
Thomas Kluyver -
Show More
@@ -158,20 +158,20 b' prompt_abbreviations = {'
158 r'\W' : '{cwd_last}',
158 r'\W' : '{cwd_last}',
159 # These X<N> are an extension to the normal bash prompts. They return
159 # These X<N> are an extension to the normal bash prompts. They return
160 # N terms of the path, after replacing $HOME with '~'
160 # N terms of the path, after replacing $HOME with '~'
161 r'\X0': '{cwd_x[0])}',
161 r'\X0': '{cwd_x[0]}',
162 r'\X1': '{cwd_x[1])}',
162 r'\X1': '{cwd_x[1]}',
163 r'\X2': '{cwd_x[2])}',
163 r'\X2': '{cwd_x[2]}',
164 r'\X3': '{cwd_x[3])}',
164 r'\X3': '{cwd_x[3]}',
165 r'\X4': '{cwd_x[4])}',
165 r'\X4': '{cwd_x[4]}',
166 r'\X5': '{cwd_x[5])}',
166 r'\X5': '{cwd_x[5]}',
167 # Y<N> are similar to X<N>, but they show '~' if it's the directory
167 # Y<N> are similar to X<N>, but they show '~' if it's the directory
168 # N+1 in the list. Somewhat like %cN in tcsh.
168 # N+1 in the list. Somewhat like %cN in tcsh.
169 r'\Y0': '{cwd_y[0])}',
169 r'\Y0': '{cwd_y[0]}',
170 r'\Y1': '{cwd_y[1])}',
170 r'\Y1': '{cwd_y[1]}',
171 r'\Y2': '{cwd_y[2])}',
171 r'\Y2': '{cwd_y[2]}',
172 r'\Y3': '{cwd_y[3])}',
172 r'\Y3': '{cwd_y[3]}',
173 r'\Y4': '{cwd_y[4])}',
173 r'\Y4': '{cwd_y[4]}',
174 r'\Y5': '{cwd_y[5])}',
174 r'\Y5': '{cwd_y[5]}',
175 # Hostname up to first .
175 # Hostname up to first .
176 r'\h': HOSTNAME_SHORT,
176 r'\h': HOSTNAME_SHORT,
177 # Full hostname
177 # Full hostname
@@ -194,7 +194,7 b' prompt_abbreviations = {'
194 # More utilities
194 # More utilities
195 #-----------------------------------------------------------------------------
195 #-----------------------------------------------------------------------------
196
196
197 def cwd_filt(self, depth):
197 def cwd_filt(depth):
198 """Return the last depth elements of the current working directory.
198 """Return the last depth elements of the current working directory.
199
199
200 $HOME is always replaced with '~'.
200 $HOME is always replaced with '~'.
@@ -204,7 +204,7 b' def cwd_filt(self, depth):'
204 out = os.sep.join(cwd.split(os.sep)[-depth:])
204 out = os.sep.join(cwd.split(os.sep)[-depth:])
205 return out or os.sep
205 return out or os.sep
206
206
207 def cwd_filt2(self, depth):
207 def cwd_filt2(depth):
208 """Return the last depth elements of the current working directory.
208 """Return the last depth elements of the current working directory.
209
209
210 $HOME is always replaced with '~'.
210 $HOME is always replaced with '~'.
General Comments 0
You need to be logged in to leave comments. Login now