diff --git a/rsbbs/console.py b/rsbbs/console.py index 862a51a..ce0fa1a 100644 --- a/rsbbs/console.py +++ b/rsbbs/console.py @@ -16,6 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import io import logging import sys @@ -42,6 +43,15 @@ class Console(): self.pluginloader = PluginLoader(self) self.pluginloader.load_plugins() + # Configure stdin and stdout newlines and encoding + # when invoked by ax25: + if not sys.stdin.isatty(): + sys.stdout = io.TextIOWrapper(sys.stdout.detach(), + newline=None) + + sys.stdin = io.TextIOWrapper(sys.stdin.detach(), + newline=None) + # # Input and output #