我在 PI 上运行 Armbian,并通过串行 USB TTL 适配器对其进行操作。
我正在运行以下命令来连接到 PI:
screen /dev/tty.usbXXXX 115200
我可以成功登录并运行命令,但是当我尝试粘贴长文件时,由于换行符被破坏,事情变得非常错误。
例如,如果我复制并粘贴以下文件(CRLF):
version: "3.9"
services:
ip-initializer:
image: myImage
restart: unless-stopped
environment:
MODULE: ip-initializer
IP: 10.0.0.19
LOGLEVEL: info
volumes:
- ./docker-compose.yml:/docker-compose.yml
- ./logs:/logs
privileged: true
network_mode: host
cap_add:
- NET_ADMIN
healthcheck:
test: ["CMD-SHELL", "ip addr show dev eth0 | grep -q $$IP || exit 1"]
telnet-haas:
image: myImage
restart: unless-stopped
environment:
MODULE: telnet-haas
IP: 10.0.0.20
PORT: 8081
DPRINT_PORT: 8080
COMMANDS: '["?Q102", "?Q100", "?Q500", "?Q303", "?Q201", "?Q600 8505", "?Q600 8511", "?Q600 8512", "?Q600 8515", "?Q600 3011", "?Q600 3027"]'
LOGLEVEL: info
devices:
- '/dev/ttyS1:/dev/ttyOpto'
volumes:
- ./logs:/logs
ports:
- "10.0.0.20:8081:8081/tcp"
- "10.0.0.20:8080:8080/tcp"
depends_on:
- ip-initializer:
condition: service_healthy
telnet-haas2:
image: myImage
restart: unless-stopped
environment:
MODULE: telnet-haas2
IP: 10.0.0.21
PORT: 8081
DPRINT_PORT: 8080
COMMANDS: '["?Q102", "?Q100", "?Q500", "?Q303", "?Q201", "?Q600 8505", "?Q600 8511", "?Q600 8512", "?Q600 8515", "?Q600 3011", "?Q600 3027"]'
LOGLEVEL: info
devices:
- '/dev/ttyS2:/dev/ttyOpto'
volumes:
- ./logs:/logs
ports:
- "10.0.0.21:8081:8081/tcp"
- "10.0.0.21:8080:8080/tcp"
depends_on:
- ip-initializer:
condition: service_healthy
该系列将产生:
它添加了换行符,并且即使没有按下任何键,似乎也会编辑内容。
我需要改变什么来解决这个问题吗?
编辑:
将以下行添加到 ~/.nanorc 就可以了:
unbind ^J main
答案1
添加以下行就可以~/.nanorc
解决问题:
unbind ^J main