JBTerminalWidget and CJK character support

Hello,I’m developing the MicroPython Tools plugin. One of the features it offers is a REPL terminal to facilitate communicating with the device’s REPL. I use JBTerminalWidget for this, here is how it’s implemented:

private fun jediTermWidget(project: Project, disposable: Disposable, connector: TtyConnector): JComponent {
val componentRegistryService = project.service()
val mySettingsProvider = JBTerminalSystemSettingsProvider()
val terminal = JBTerminalWidget(project, mySettingsProvider, disposable)
componentRegistryService.registerTerminal(terminal)
terminal.isEnabled = false
with(terminal.terminal) {
    setModeEnabled(TerminalMode.ANSI, true)
    setModeEnabled(TerminalMode.AutoNewLine, true)
    setModeEnabled(TerminalMode.WideColumn, true)
}
terminal.ttyConnector = connector
terminal.start()

val widget = BorderLayoutPanel()
widget.addToCenter(terminal)
val actions = ActionManager.getInstance().getAction("micropythontools.repl.ReplToolbar") as ActionGroup
val actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.TOOLBAR, actions, true)
actionToolbar.targetComponent = terminal
widget.addToTop(actionToolbar.component)
return widget
}

It works great for ANSI color codes, translating input like MicroPython shortcuts (Ctrl + A…), sending arrow keys for going through the MicroPython REPL command history and so on.

However, some of my plugin’s users are running into problems with CJK character getting truncated:

Is this a known limitation of JBTerminalWidget? Is there some workaround/alternative element that does what JBTerminalWidget does and that would support CJK characters on top of that?

Still running into issues with wrapping and double-width characters.

Hello!
We are now working on providing an API for the Reworked Terminal: IJPL-193161
Since the Reworked Terminal is using Editor component to render the output, there should be no problems with CJK characters rendering.
So, I would propose looking into using the Reworked Terminal implementation once API is available. ETA is 2025.3 release.

But regarding the existing problem: it looks like the output is also truncated.
Could you please ask the users to try reproducing the same in the terminal tool window? (but they need to enable Classic terminal engine in Settings | Tools | Terminal)
If they use Windows, I suspect it might be connected to ConPTY bugs.
Please check that they do have -Dcom.pty4j.windows.disable.bundled.conpty=true VM option.