chore(deps): replace deprecated xterm packages

This commit is contained in:
Mrugesh Mohapatra
2026-04-19 22:30:12 +05:30
parent 6b497e48e8
commit 7a5a6a4035
4 changed files with 34 additions and 105 deletions

View File

@@ -8,7 +8,7 @@ import { useMediaQuery } from 'react-responsive';
import { bindActionCreators, Dispatch } from 'redux';
import store from 'store';
import { editor } from 'monaco-editor';
import type { FitAddon } from 'xterm-addon-fit';
import type { FitAddon } from '@xterm/addon-fit';
import { useFeature } from '@growthbook/growthbook-react';
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';

View File

@@ -1,6 +1,6 @@
import React, { MutableRefObject, useEffect, useRef } from 'react';
import type { IDisposable, Terminal } from 'xterm';
import type { FitAddon } from 'xterm-addon-fit';
import type { FitAddon } from '@xterm/addon-fit';
import type { IDisposable, Terminal } from '@xterm/xterm';
import { useTranslation } from 'react-i18next';
import { registerTerminal } from '../utils/python-worker-handler';
@@ -35,8 +35,8 @@ export const XtermTerminal = ({
async function createTerminal() {
const disposables: IDisposable[] = [];
const { Terminal } = await import('xterm');
const { FitAddon } = await import('xterm-addon-fit');
const { Terminal } = await import('@xterm/xterm');
const { FitAddon } = await import('@xterm/addon-fit');
// Setting convertEol so that \n is converted to \r\n. Otherwise the terminal
// will interpret \n as line feed and just move the cursor to the next line.