diff --git a/klippy/extras/gcode_macro.py b/klippy/extras/gcode_macro.py index e1f307658f09..e8da15be1da6 100644 --- a/klippy/extras/gcode_macro.py +++ b/klippy/extras/gcode_macro.py @@ -192,7 +192,9 @@ def cmd_SHOW_MACRO(self, gcmd): kwparams['params'] = gcmd.get_command_parameters() kwparams['rawparams'] = gcmd.get_raw_command_parameters() renderstring = self.template.render(kwparams) - self.gcode.respond_info("after render: %s" %(renderstring,)) + # 去除空行 + result = "\n".join(filter(lambda line: line.strip(), renderstring.split("\n"))) + self.gcode.respond_info("after render:\n %s" %(result,)) def cmd(self, gcmd): if self.in_script: