@@ -38,7 +38,7 @@ def build_all(self, button):
3838 # print(_final_line)
3939 if _final_line is not None :
4040 self .m ._cmd_entry .set_text (_final_line .strip ())
41- self .m ._cmd_entry .grab_focus ()
41+ # self.m._cmd_entry.grab_focus()
4242
4343 def run_cmdline (self , button ):
4444 '''
@@ -50,9 +50,13 @@ def run_cmdline(self, button):
5050 if IS_POSIX :
5151 self .w .main_notebook .next_page ()
5252 _cmdline_str = '%s %s\n ' % (sqlmap_path , _sqlmap_opts )
53- # print(_cmdline_str)
53+ # print(_cmdline_str, len(_cmdline_str.encode('utf8')) )
5454 # self.m._page2_cmdline_str_label.set_text("running: " + _cmdline_str)
55- self .m ._page2_terminal .feed_child (_cmdline_str , len (_cmdline_str ))
55+ if Vte .MAJOR_VERSION >= 0 and Vte .MINOR_VERSION > 52 :
56+ self .m ._page2_terminal .feed_child_binary (_cmdline_str .encode ('utf8' ))
57+ else :
58+ # 旧版本的api, len()还要用encode后的长度
59+ self .m ._page2_terminal .feed_child (_cmdline_str , len (_cmdline_str .encode ('utf8' )))
5660 self .m ._page2_terminal .grab_focus ()
5761
5862 def respawn_terminal (self , button ):
@@ -757,9 +761,19 @@ def _escape_quote(self, widget_text):
757761
758762
759763def main ():
764+ from widgets import d
760765 from sqlmap_gtk import Window
761766
762767 win = Window ()
768+
769+ css_provider = g .CssProvider .new ()
770+ css_provider .load_from_path ('css.css' )
771+ g .StyleContext .add_provider_for_screen (
772+ d .Screen .get_default (),
773+ css_provider ,
774+ g .STYLE_PROVIDER_PRIORITY_APPLICATION
775+ )
776+
763777 win .connect ('destroy' , g .main_quit )
764778 win .show_all ()
765779 g .main ()
0 commit comments