diff --git a/netmiko/zyxel/zyxel_ssh.py b/netmiko/zyxel/zyxel_ssh.py index fd66b34ee..618ac8535 100644 --- a/netmiko/zyxel/zyxel_ssh.py +++ b/netmiko/zyxel/zyxel_ssh.py @@ -1,3 +1,5 @@ +import re + from typing import Any, Sequence, Iterator, TextIO, Union from netmiko.base_connection import BaseConnection from netmiko.no_enable import NoEnable @@ -28,3 +30,8 @@ def session_preparation(self) -> None: super().session_preparation() # Zyxel switches output ansi codes self.ansi_escape_codes = True + + def strip_ansi_escape_codes(self, string_buffer: str) -> str: + """Replace '^J' code by next line""" + output = re.sub(r"^\^J", self.RETURN, string_buffer) + return super().strip_ansi_escape_codes(output)