#580: Use bashlex in generic shell

This commit is contained in:
Vladimir Iakovlev
2017-01-09 17:50:23 +01:00
parent d1b9492085
commit a6f63c0568
2 changed files with 14 additions and 13 deletions
-11
View File
@@ -1,5 +1,4 @@
import os
import bashlex
from ..conf import settings
from ..utils import memoize
from .generic import Generic
@@ -46,13 +45,3 @@ class Bash(Generic):
else:
config = 'bash config'
return 'eval $(thefuck --alias)', config
def split_command(self, command):
generic = Generic()
# If bashlex fails for some reason, fallback to shlex
# See https://github.com/idank/bashlex#limitations
try:
return generic.decode_utf8(list(bashlex.split(generic.encode_utf8(command))))
except:
return generic.split_command(command)