Open HanyzPAPU opened 1 month ago
Would it be safe to call using_history()
even with GNU Readline? The history would technically get initialized twice.
Looking at the documentation and into the official examples I think we should call using_history
ourselves and it is a bug to not call it.
Generally I would prefer if we would be able to work with the editline
to simplify the building process a bit.
Perhaps we should add building on Mac to our GitHub Actions too?
From what I've seen, there were one or two students using Mac each year. I think it would be a good idea to have MSIM prebuilt for them.
The
clear_history()
call in input.c:188 segfaults when msim is compiled on mac.I found out that this is caused because instead of GNU Readline, macOS is distributed with BSD editline, which provides a mock implementation if the readline API. There is one crucial difference: the editline mock does not call the
using_history()
(link) function and thus does not initialize the history state.Adding the
using_history()
call to the initializer solves the issue. An alternative solution would be to manually link msim with readline instead of relying on the system library.