Fluentterminal: Colors lost when dragging tab to new window

Created on 15 Jan 2020  路  5Comments  路  Source: felixse/FluentTerminal

When a tab contains code colored using ANSI escape sequences and it is dragged to create a new window, the colors are lost.

Zg7HbK7WBW

Here's the file I used in the preview above: https://gist.github.com/mlocati/fdabcaeb8071d5c75a2d51712db24011

bug

Most helpful comment

Yes, this is a known restriction. It can be fixed once https://github.com/xtermjs/xterm.js/pull/2369 is merged

All 5 comments

Yes, this is a known restriction. It can be fixed once https://github.com/xtermjs/xterm.js/pull/2369 is merged

Yes, this is a known restriction. It can be fixed once xtermjs/xterm.js#2369 is merged

The serialize-addon is not mature currently. Serializing API may change in the future. Anyway, I'm glad my plugin can fix this problem.

BTW, What happened when a tab is dragged out. Can you show me where the code is? Maybe it will help me to design a better API for that addon

Hey @JavaCS3 current "temporary" solution in Fluent is based exactly on your source code ( I believe I have mentioned you by nickname when created PR with your source code ). It seems I've modified plugin's source code slightly to match Fluent needs, but can't remember for sure right now what changes were made.

After I took a quick look at the impl, I found the answer.
Whenever a tab is teared off. It will call the serialize addon to dump the internal xterm.js state into a string. And restore that state whenever it's needed.

https://github.com/felixse/FluentTerminal/blob/d1bf35607ea6d8b25a3662c0dfb0b0c4d91cd14e/FluentTerminal.App/App.xaml.cs#L671-L677

https://github.com/felixse/FluentTerminal/blob/d1bf35607ea6d8b25a3662c0dfb0b0c4d91cd14e/FluentTerminal.App.ViewModels/TerminalViewModel.cs#L43-L78

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Loreno10 picture Loreno10  路  5Comments

DRSDavidSoft picture DRSDavidSoft  路  7Comments

Sharlaan picture Sharlaan  路  6Comments

SheepDomination picture SheepDomination  路  6Comments

hanskokx picture hanskokx  路  7Comments