I need a prompt where users can input text in multiple languages, say Python and Bash, and I want it to be highlighted accordingly while the user is typing. Detecting the languages is pretty easy with Python and Bash ASTs (using bashlex). But I wonder how to implement some mechanism for switching lexers dynamically? In principle xonsh should be doing exactly that. I'd be grateful for specific advice, though. Maybe it's also an interesting feature to add to the docs.
I need a prompt where users can input text in multiple languages, say Python and Bash, and I want it to be highlighted accordingly while the user is typing. Detecting the languages is pretty easy with Python and Bash ASTs (using bashlex). But I wonder how to implement some mechanism for switching lexers dynamically? In principle xonsh should be doing exactly that. I'd be grateful for specific advice, though. Maybe it's also an interesting feature to add to the docs.