Skip to content

Commit

Permalink
Zyxel: Correction of ANSI characters of next line
Browse files Browse the repository at this point in the history
  • Loading branch information
k-ribot committed Sep 5, 2023
1 parent f0ea895 commit 54aa193
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.base_connection import BaseConnection
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 54aa193

Please sign in to comment.