mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
Prevent os.path.normpath from removing initial ‘./’
Closes upstream #307.
This commit is contained in:
parent
4092f6a845
commit
b49d6c958d
1 changed files with 8 additions and 1 deletions
|
@ -35,6 +35,13 @@ for ((i=0;i<${{#COMPREPLY[*]}};i++)) do echo ${{COMPREPLY[i]}}; done
|
|||
"""
|
||||
|
||||
|
||||
def _normpath(p):
|
||||
# Prevent normpath() from removing initial ‘./’
|
||||
if p.startswith('./'):
|
||||
return './' + os.path.normpath(p[2:])
|
||||
return os.path.normpath(p)
|
||||
|
||||
|
||||
class Completer(object):
|
||||
"""This provides a list of optional completions for the xonsh shell."""
|
||||
|
||||
|
@ -173,7 +180,7 @@ class Completer(object):
|
|||
self._add_dots(paths, prefix)
|
||||
if cdpath:
|
||||
self._add_cdpaths(paths, prefix)
|
||||
return {os.path.normpath(s) for s in paths}
|
||||
return {_normpath(s) for s in paths}
|
||||
|
||||
def bash_complete(self, prefix, line, begidx, endidx):
|
||||
"""Attempts BASH completion."""
|
||||
|
|
Loading…
Add table
Reference in a new issue