From nobody Wed Oct 20 07:34:31 2021 X-Original-To: dev-commits-src-main@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 4989F17FAE06; Wed, 20 Oct 2021 07:34:32 +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 4HZ2S80SV9z56BM; Wed, 20 Oct 2021 07:34:32 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C910C2376B; Wed, 20 Oct 2021 07:34:31 +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 19K7YVlg090856; Wed, 20 Oct 2021 07:34:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K7YVTH090855; Wed, 20 Oct 2021 07:34:31 GMT (envelope-from git) Date: Wed, 20 Oct 2021 07:34:31 GMT Message-Id: <202110200734.19K7YVTH090855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: ef0d94a3d34c - main - sh(1): interactive mode improvement List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef0d94a3d34c880bd9f86cd842ee01b6075bc1d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=ef0d94a3d34c880bd9f86cd842ee01b6075bc1d8 commit ef0d94a3d34c880bd9f86cd842ee01b6075bc1d8 Author: Baptiste Daroussin AuthorDate: 2021-10-19 06:37:47 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 07:33:04 +0000 sh(1): interactive mode improvement In the default configuration add 2 bindings which has been requested by many during the HEADSUP discussion: * csh like arrow history navigation * ctrl-arrow to jump from word to words Add an alias to make the history command exist as an alias to fc -l. --- bin/sh/dot.shrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/sh/dot.shrc b/bin/sh/dot.shrc index 5277e5b07b0a..5a111a61a38d 100644 --- a/bin/sh/dot.shrc +++ b/bin/sh/dot.shrc @@ -31,6 +31,15 @@ # alias mv='mv -i' # alias rm='rm -i' +# # csh like history on arrow up and down +bind ^[[A ed-search-prev-history +bind ^[[B ed-search-next-history + +# # ctrl+arrow allow to jump from words to words +bind "\\e[1;5C" em-next-word +bind "\\e[1;5D" ed-prev-word +alias history='fc -l' + # read(2) of directories may not be desirable by default, as this will provoke # EISDIR errors from each directory encountered. # alias grep='grep -d skip'