Message ID | 20240202065608.14019-1-jirislaby@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-49315-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp252966dyc; Thu, 1 Feb 2024 23:02:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IFG/Yr5P0O4n11AsVzDtSepyUwU4DO+Ygwov8L+rvvCsUw3pzl1bjaJJlPLhamc9lc9oACn X-Received: by 2002:a17:90a:d488:b0:293:e300:97ef with SMTP id s8-20020a17090ad48800b00293e30097efmr4732665pju.16.1706857339718; Thu, 01 Feb 2024 23:02:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706857339; cv=pass; d=google.com; s=arc-20160816; b=M9QS1Xyhbv1VgFLhxyvos6vSZSvKh+9YPmYtXRROn+XMrDACEIlVbIgAhQhHJfThkt dfDfypdvFUjwmrVUQdfkcMAahIXFaKM5+LMgo01I7QJZAx5jg3jX/fgR2y++TVxZuqER 3NvLMCQXLwufQhJzbbSuJ5GRIFvD5eeKT+n3nltsCyJ5VOWbCuF6sBrSUg/NkepDjGkP 56ejVdEx6FT6whDpCIUeBBrh9Vabjqnxh02dtOeiH2qXR30LqCdyMmnvm3ZCnLt4D1UJ yMHTIeLAS9MCBviz25PoljJVLsRQ30CGH74onMOutdBXfklgUsDYxJq9hSRsaWI3Oev+ BGwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=yOHBSvCLwxG9+pNAUrL+GGO9jOSzlBaWH4cXF9fZvQs=; fh=QKsP4hwo+D9K09dPVr5Quyal0FjBOPe+dApm2fIQ7uM=; b=x6mZTHt5pimKXVE1UlfRvQvCLwldq9oiU7ycm51cvjSXJL0Fs6Mxz6OKvMc3JoF4kI R58Irsb3Rx1sB+GP0XssFj77kV+LeybXFwCAh1u+ANXaWiCeDAle0N9f44i5EohoBb0X u2WqxSYTJG1UW/2F03ng7qL/fM025VQk7LFy0ytSp0aj1SW5dZSspzPWxFT1wyTSmFof SQi1lcgiVKw6pYTnLciUkDkjsmkHdoyEIO71o2TFKH/aW5rwo847ZxHvJMr4Iis0VxxE 21YaZA9QtrUZ8/mRUW8DObF6mjLtEKLJ8/lDzXrUk7R9wBC4oqG4RQ9M5mEOMb7/7GQX 2TwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g08hhqq6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49315-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49315-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUOMWidvOTx4SNY+rnMEXOcfK/NMacwmoK9xOkIvwxn7DXVUUtE3+eu3o4WnpdowJphXySiWP+hqsfKRG+1BZjjBeVqYg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q44-20020a17090a17af00b002900e52586fsi1210065pja.20.2024.02.01.23.02.19 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 23:02:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49315-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g08hhqq6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49315-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49315-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 78A6628F7EA for <ouuuleilei@gmail.com>; Fri, 2 Feb 2024 06:56:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4063117BAC; Fri, 2 Feb 2024 06:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g08hhqq6" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8155617567; Fri, 2 Feb 2024 06:56:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706856972; cv=none; b=XHBwgRe/Lrrm87zIpiZ58WNfHc1d5/FT39MQsZxvQgYmDqmXwboyfWPJ7hsWuiv+Gqb7SoZJ7thlEgbRnh0qSvWRuuDNAwYPIfOnMPFQ8sNhnBJKdcWmfhaJdM0kl8EZefZZYHGyuSabA2HqOx3Q6pWTDk35/Hm0k7QR5RVpU2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706856972; c=relaxed/simple; bh=Tb+Xie0eU0KycmdJdnMo1LjLbaYJ6rW5HUuzFiLn2OI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=myUxtT+pcsBd8rqwixudlUVO/bShWJ9hYJT9z3waqzzu85BUdzmMBoDRajFbx7vXvC7uM5Ev7EEdyuomLAAXKDdSiJ0gjphk4ExHamrstXKQh6uqgQx2Qs6gsgy8KIpjdhCvR6Gjm1g3crkMp3JhTxgiEYAejeGTbfT85T1Q/Jk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g08hhqq6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4954C433F1; Fri, 2 Feb 2024 06:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706856972; bh=Tb+Xie0eU0KycmdJdnMo1LjLbaYJ6rW5HUuzFiLn2OI=; h=From:To:Cc:Subject:Date:From; b=g08hhqq6f2FrBtz4ISWyaneEHHAoNRuc4zvRWe6oKq1sK+E5Uv7ejYEPhDdNu0KxW 06EdzH4guN1+IyjkjCelYQGA44a9N+9w4r0Tvwz5W5U2azbPx37NCClA4lRUOOOM2E Uj7nMsl0673VFr2+K0IOxvQPejNYDnUoar2PlOcAM18J2wXNlCYUR4sMUbyVhQ8QKn MfA6mEscHlQ05r2ig3Zu9lJNxWFYk2v3S5G5cPDPWQ5ZAJpvlZeU4R67nCkmL30Bnw 1E4Ph8Ciw7Nn0/e6OtBBLhKK5T/LO03Y9G7SHxE58c6znYD2dvAyYLC//VvjnZ+qdD K34HjSx0NajhQ== From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Subject: [PATCH 00/22] tty: vt: cleanup ESC sequences handling Date: Fri, 2 Feb 2024 07:55:46 +0100 Message-ID: <20240202065608.14019-1-jirislaby@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789769641854627095 X-GMAIL-MSGID: 1789769641854627095 |
Series |
tty: vt: cleanup ESC sequences handling
|
|
Message
Jiri Slaby
Feb. 2, 2024, 6:55 a.m. UTC
This is a promised followup of "tty: vt: cleanup and documentation" [1]. The escape sequences parser is cleaned up, so that it is easier to follow. Most of the patches are easier to review with '-w -b' passed to git diff (as the code is moved to separate functions with a different level of indentation only). [1] https://lore.kernel.org/all/20240122110401.7289-28-jirislaby@kernel.org/T/ Jiri Slaby (SUSE) (22): tty: vt: make rgb_from_256() slighly more comprehensible tty: vt: define enums for CSI+h/l codes tty: vt: rename set_mode() to csi_hl() tty: vt: split DEC CSI+h/l handling into csi_DEC_hl() tty: vt: remove unneeded assignment of EPecma to vc_priv tty: vt: move CSI+n handling along to other ECMA CSIs tty: vt: define an enum for CSI+] codes tty: vt: rename setterm_command() to csi_RSB() tty: vt: put cases on separate lines tty: vt: accept u8 in do_con_trol() and vc_setGx() tty: vt: extract ascii handling to handle_ascii() tty: vt: separate ESesc state handling into handle_esc() tty: vt: move CSI DEC handling to a separate function tty: vt: move CSI ECMA handling to a separate function tty: vt: name, reflow and document enum vc_ctl_state tty: vt: simplify ansi_control_string() tty: vt: handle CSI+[ inside preexisting switch-case tty: vt: add new helper for reseting vc parameters tty: vt: use switch+case in the ESnonstd case tty: vt: use switch+case in the ESgetpars case tty: vt: use ASCII enum constants in vt_console_print() tty: vt: decrypt magic constants in vc_is_control() drivers/tty/vt/vt.c | 876 ++++++++++++++++++++++++++------------------ 1 file changed, 514 insertions(+), 362 deletions(-)