IRkernel icon indicating copy to clipboard operation
IRkernel copied to clipboard

Implement stdin protocol

Open takluyver opened this issue 10 years ago • 4 comments

The R readline function should, inside IRkernel, use the Jupyter protocol stdin messages to prompt the user for input.

Slight complication: should we then make interactive() return TRUE? That appears to be the signal that you can use readline(), but it also affects some other bits of behaviour, which we may not want.

takluyver avatar Oct 06 '15 14:10 takluyver

there is AFAIK only readline and menu directly using the terminal, everything else uses stdin(). do we have to monkeypatch the former two or is there another solution?

i think we should make interactive() return true. after all the notebook is interactive. we simply need to catch and circumvent the unwanted bits of behavior (e.g. X11/quartz/windows as default device instead of pdf)

flying-sheep avatar Oct 09 '15 12:10 flying-sheep

+1 for The R readline function should, inside IRkernel, use the Jupyter protocol stdin messages to prompt the user for input.

pieterlukasse avatar Oct 13 '15 09:10 pieterlukasse

it would be nice to have this feature. +1

forus avatar Oct 13 '15 09:10 forus

@pieterlukasse @forus sure it would, but i have no idea how to do this cleanly. if you want this, please consider researching how to best intercept the input methods for R’s readline and menu functions.

i.e. if there’s a better way than

unlockBinding('readline', baseenv())
assign('readline', function(prompt = '') { ... }, envir = baseenv())
lockBinding('readline', baseenv())

flying-sheep avatar Oct 13 '15 09:10 flying-sheep