From nobody Sun Oct 02 17:31:35 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MgWGv4T7tz4V0Hd; Sun, 2 Oct 2022 17:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MgWGv42S8z3Hph; Sun, 2 Oct 2022 17:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664731895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=teqaxRyFjwSkmWL4+Ryr3pFeannAdgRXYEXCL7qlqBk=; b=UPLIoJHvMjkr9BmQuyIfEgtKEE0TmaBMzJXDWo+982lupIY2eeDpxpLSIcQ6sJVlxZULaZ KnhhYjegDyh8+PFGJ+ZYSqiywEsvXjfrcgby4WwzbhLRrHCVejXj5CXMTtHvZbtDS2CTBH RyzU8GrESW8/wKVfFYHGNZV5aVDGZ8O/f+k0FLa0SCSwWVuO845sW31tzA5WbvBXDvDtXd 8gQkG7m7VAry+EJcH22ZBTMyrTPXpm6VelfAvs8empbZV7eBVao98KeQld///qUuurdEWd MCbVjzflu+ZzhBt8o278t7xKRpekdHmlmmH++RpJQ7pNwPS+ueyuPftDaBla6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MgWGv34fGzwZ2; Sun, 2 Oct 2022 17:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 292HVZDI039178; Sun, 2 Oct 2022 17:31:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 292HVZUq039177; Sun, 2 Oct 2022 17:31:35 GMT (envelope-from git) Date: Sun, 2 Oct 2022 17:31:35 GMT Message-Id: <202210021731.292HVZUq039177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a7eac018437e - main - stty(1): provide details about interaction with job control List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7eac018437e592a575f46a59151eedc7a742fa7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664731895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=teqaxRyFjwSkmWL4+Ryr3pFeannAdgRXYEXCL7qlqBk=; b=JDaKjDcOIGkSdfxLdofczDtlLVXGPNGR6en07hr0Wlz1I2IIkyWaEmf+vm2CvqvflidQQ5 smTLK0AnZ3zX7Y+uczDRtYqNQJN7RgJdoB6EEs+2J/mLh/sy3zfcPY1eEw2s957hJoul0y Ooq4euK+B832mQBTgYlVCY03za1shAMpEBONNKXSWHa7SHC6iGS0jjVm/hGrC+OttFKY8w J25iQWUietuzuOwQK5YzMaurVNZRLAsAvaJqkaFnjgRcbEtjIjBik1caBz2otdaBi6VQC4 KCnE/RsnABsbiXClpVcoadMAX47kG89Cby+sML9cFaGlsuBLi6F0s+tL0743oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664731895; a=rsa-sha256; cv=none; b=pwawY2fbxFE6KP6XsEUsGmw0RLHKqrF9BbrVM+MSnOdsI50zqzY3Xi/AtKI39tlx/+IH86 30s1eF/7CENnhkudXGSSHujQBoa0nMYMvHpSokmWwaDX02F6IdIYhKEWy94T/AFQujvJhZ EEpmr7+0Oxt1Aq9+steggRMKss5JFWkb9PoGPAH8crmUJog6JBwMTG9tnveaJflaD4PZie wTYH2UFl06GgX/mtitqv0Ned2Hwx4EfHj0QWRBwOVO4+J/K6D+fMgP3N4vU9XLVX+VRvci XhlK2gcDSDVLWE8z5QfF3R4pTlr0HXvL6HUKdeSUp25pFudEl+GyDHs0Npfmtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a7eac018437e592a575f46a59151eedc7a742fa7 commit a7eac018437e592a575f46a59151eedc7a742fa7 Author: Konstantin Belousov AuthorDate: 2022-09-26 21:34:22 +0000 Commit: Konstantin Belousov CommitDate: 2022-10-02 17:29:53 +0000 stty(1): provide details about interaction with job control Describe a shell trick to do non-blocking modification of the terminal settings, by ignoring job control signals with trap built-in. PR: 266627 With input from: jilles Reviewed by: pauamma Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D36745 --- bin/stty/stty.1 | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/bin/stty/stty.1 b/bin/stty/stty.1 index 67a32c089150..83f5d4da0b82 100644 --- a/bin/stty/stty.1 +++ b/bin/stty/stty.1 @@ -32,7 +32,7 @@ .\" @(#)stty.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 24, 2022 +.Dd September 27, 2022 .Dt STTY 1 .Os .Sh NAME @@ -594,6 +594,32 @@ Same as the control character Same as the control character .Cm reprint . .El +.Sh INTERACTION WITH JOB CONTROL +Modifications to the terminal settings are treated by job control +(see +.Xr termios 4 ) +same as writes. +When the +.Nm +utility is executing in a background process group, +such attempts result in the kernel sending the +.Dv SIGTTOU +signal and stopping the process until its group is returned +to foreground. +The non-blocking open of the terminal device with the +.Fl f +option to +.Nm +does not affect the behavior. +If it is desirable to modify the settings from the background, +.Xr sh 1 +users might utilize the following idiom: +.Bd -literal +(trap '' TTOU; stty -f /dev/tty sane) +.Ed +.Pp +Note that changing terminal settings for a running foreground +job that is not prepared for it might cause inconsistencies. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO