@@ -87,8 +87,14 @@ class MyCli(object):
8787 '~/.my.cnf'
8888 ]
8989
90+ # check XDG_CONFIG_HOME exists and not an empty string
91+ if os .environ .get ("XDG_CONFIG_HOME" ):
92+ xdg_config_home = os .environ .get ("XDG_CONFIG_HOME" )
93+ else :
94+ xdg_config_home = "~/.config"
9095 system_config_files = [
9196 '/etc/myclirc' ,
97+ os .path .join (xdg_config_home , "mycli" , "myclirc" )
9298 ]
9399
94100 default_config_file = os .path .join (PACKAGE_ROOT , 'myclirc' )
@@ -162,7 +168,7 @@ def __init__(self, sqlexecute=None, prompt=None,
162168 prompt_cnf = self .read_my_cnf_files (self .cnf_files , ['prompt' ])['prompt' ]
163169 self .prompt_format = prompt or prompt_cnf or c ['main' ]['prompt' ] or \
164170 self .default_prompt
165- self .prompt_continuation_format = c ['main' ]['prompt_continuation' ]
171+ self .multiline_continuation_char = c ['main' ]['prompt_continuation' ]
166172 keyword_casing = c ['main' ].get ('keyword_casing' , 'auto' )
167173
168174 self .query_history = []
@@ -539,8 +545,14 @@ def get_message():
539545 prompt = self .get_prompt ('\\ d> ' )
540546 return [('class:prompt' , prompt )]
541547
542- def get_continuation (width , line_number , is_soft_wrap ):
543- continuation = ' ' * (width - 1 ) + ' '
548+ def get_continuation (width , * _ ):
549+ if self .multiline_continuation_char :
550+ left_padding = width - len (self .multiline_continuation_char )
551+ continuation = " " * \
552+ max ((left_padding - 1 ), 0 ) + \
553+ self .multiline_continuation_char + " "
554+ else :
555+ continuation = " "
544556 return [('class:continuation' , continuation )]
545557
546558 def show_suggestion_tip ():
@@ -575,6 +587,8 @@ def one_iteration(text=None):
575587 else :
576588 self .echo ('Wise choice!' )
577589 return
590+ else :
591+ destroy = True
578592
579593 # Keep track of whether or not the query is mutating. In case
580594 # of a multi-statement query, the overall query is considered
0 commit comments