Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursion error from r built-in #510

Closed
posguy99 opened this issue Aug 5, 2022 · 4 comments
Closed

Recursion error from r built-in #510

posguy99 opened this issue Aug 5, 2022 · 4 comments
Labels
wontfix This will not be worked on

Comments

@posguy99
Copy link

posguy99 commented Aug 5, 2022

@McDutchie Related to r, here's something odd (this is a freshly started shell):

$ r                                                                                                        
r
r
r
r
r
r
-ksh: hist: history: recursion too deep
$

I have no idea what caused it, and I can't make it happen again. it's just weird. The current history...

$ history
564	port contents ctags
565	port info universal-ctags
566	port info ctags
567	sudo port selfupdate
568	port outdated
569	sudo port upgrade -u outdated
570	sudo port upgrade -u outdated
571	cd ksh
572	git log | grep -i alias
573	m NEWS
574	/bin/ksh
575	ver
576	exit
577	unalias r
578	r
579	history
$

Originally posted by @posguy99 in #503 (comment)

@posguy99
Copy link
Author

posguy99 commented Aug 5, 2022

I figured out how to get the recursion error.

Start a new shell

$ unalias r
$ r
-ksh: r: not found
$ 

Kill that shell, start a new one with the same history file.

$ r

And you get the recursion error.

@McDutchie
Copy link

I can only reproduce this if I launch the ksh shells from a shell other than ksh, which makes sense, as 'r' needs to be the last command in the history.

I'm going to go with 'not a bug' for this one. You've deliberately created a situation where the r alias recursively invokes r, and ksh happily obliges. It even fails gracefully by detecting excessive recursion instead of crashing. So I don't see a problem here.

@posguy99
Copy link
Author

posguy99 commented Aug 6, 2022

Agreed.

I can get u+ to do it as well. Sometimes you really wish ksh had HISTIGNORE. 🤷‍♂️

@posguy99
Copy link
Author

posguy99 commented Aug 6, 2022

NOTABUG

@posguy99 posguy99 closed this as completed Aug 6, 2022
@McDutchie McDutchie added the wontfix This will not be worked on label Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants