Skip to content

Commit

Permalink
Zyxel: Correction of ANSI characters of next line (#3524)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-ribot authored Nov 5, 2024
1 parent e34b895 commit fe00998
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions netmiko/zyxel/zyxel_ssh.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import re

from typing import Any, Sequence, Iterator, TextIO, Union
from netmiko.cisco_base_connection import CiscoSSHConnection
from netmiko.no_enable import NoEnable
Expand Down Expand Up @@ -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)

0 comments on commit fe00998

Please sign in to comment.