All of lore.kernel.org
 help / color / mirror / Atom feed
From: наб <nabijaczleweli@nabijaczleweli.xyz>
To: dash@vger.kernel.org
Subject: dash repeats first line in history entry forever with fc -s
Date: Sun, 8 Jan 2023 17:10:17 +0100	[thread overview]
Message-ID: <20230108160906.xf7w5vsd74kr22pc@tarta.nabijaczleweli.xyz> (raw)

[-- Attachment #1: Type: text/plain, Size: 2393 bytes --]

Hi!

Fun test for ya (--with-libedit):
  $ printf '%s\n' id 'fc 1' a ls . w q 'fc -s 1' | src/dash -i
  $ uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  $ 3
  6
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  002         autogen.sh      compile       config.status  install-sh   missing        q.cpp           q-ksh-stderr   q-zsh-stdout         stamp-h1
  003         autom4te.cache  config.h      configure      ll           q              q-dash2-stderr  q-ksh-stdout   reject_filtered_cmd  test.sh
  004         back            config.h.in   configure.ac   Makefile     q-bash-stderr  q-dash2-stdout  q-mksh-stderr  sh-stdin.sh          traptest
  005         ChangeLog       config.h.in~  COPYING        Makefile.am  q-bash-stdout  q-dash-stderr   q-mksh-stdout  sh-stdin.sh-f        tst.sh
  aclocal.m4  ChangeLog.O     config.log    depcomp        Makefile.in  q.c            q-dash-stdout   q-zsh-stderr   src                  x1.sh
  $ id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  fc -s 1
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  uid=1000(nabijaczleweli) gid=100(users) groups=100(users)
  id
  ...
  ^C
  $
  src/dash: 1: Cannot set tty process group (No such process)

Interactively, if you ^C you can then
  $ fc -l
    426 id
    427 id
    428 id
    429 id
    430 id
    431 id
    432 id
    433 id
    434 id
    435 id
    436 id
    437 id
    438 id
    439 id
    440 id
    441 id
(or, as the case may be, something in the 30000 range)
of the first command in the history entry.

I've never used the POSIX history mechanism so idk what the correct
thing it should do there is, but it's probably not this.

libedit 3.1-20191231-2+b1, dash trunk (f96ec8765cf37eb0c222a563de2f767ebfbf56db).

Best,
наб

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2023-01-08 16:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-08 16:10 наб [this message]
2023-01-08 16:31 ` dash repeats first line in history entry forever with fc -s Harald van Dijk
2023-01-08 17:01   ` Christoph Anton Mitterer
2023-02-07 19:33   ` [PATCH 1/6] fc -s: refuse multiple events instead of ignoring наб
2024-04-06  8:55     ` Herbert Xu
2023-02-07 19:33   ` [PATCH 2/6] fc -s: don't loop forever when executing the latest entry наб
2023-02-07 19:33   ` [PATCH 3/6] fc: only parse old=new if -s, per POSIX наб
2023-02-07 19:33   ` [PATCH 4/6] fc: don't require an argument наб
2023-02-07 19:33   ` [PATCH 5/6] fc: fix "fc -3" extension on glibc наб
2023-02-07 19:33   ` [PATCH 6/6] fc: don't include the current fc in out-of-range last наб

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230108160906.xf7w5vsd74kr22pc@tarta.nabijaczleweli.xyz \
    --to=nabijaczleweli@nabijaczleweli.xyz \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.