All of lore.kernel.org
 help / color / mirror / Atom feed
* dash repeats first line in history entry forever with fc -s
@ 2023-01-08 16:10 наб
  2023-01-08 16:31 ` Harald van Dijk
  0 siblings, 1 reply; 10+ messages in thread
From: наб @ 2023-01-08 16:10 UTC (permalink / raw)
  To: dash

[-- 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 --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-04-06  8:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-08 16:10 dash repeats first line in history entry forever with fc -s наб
2023-01-08 16:31 ` 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 наб

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.