File tree Expand file tree Collapse file tree 3 files changed +10
-17
lines changed Expand file tree Collapse file tree 3 files changed +10
-17
lines changed Original file line number Diff line number Diff line change 1- const tty = require ( 'tty' )
2- const terminalSize = require ( './terminal-size' )
1+ import tty from 'tty'
2+ import { get as getTerminalSize } from './terminal-size'
33
44// polyfills node's getWindowSize
55// by returning an array of columns/rows
6- function getWindowSize ( ) {
7- const { columns, rows } = terminalSize . get ( )
6+ export function getWindowSize ( ) {
7+ const { columns, rows } = getTerminalSize ( )
88
99 return [ columns , rows ]
1010}
@@ -17,7 +17,7 @@ function patchStream (patched, name) {
1717 patched [ stream . fd ] = true
1818}
1919
20- const override = ( ) => {
20+ export function override ( ) {
2121 const isatty = tty . isatty
2222
2323 const patched = {
@@ -54,9 +54,3 @@ const override = () => {
5454
5555 return
5656}
57-
58- module . exports = {
59- override,
60-
61- getWindowSize,
62- }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const electronApp = require('./lib/util/electron-app')
22const { telemetry, OTLPTraceExporterCloud } = require ( '@packages/telemetry' )
33const { apiRoutes } = require ( './lib/cloud/routes' )
44const encryption = require ( './lib/cloud/encryption' )
5+ const { override : overrideTty } = require ( './lib/util/tty' )
56
67const { calculateCypressInternalEnv, configureLongStackTraces } = require ( './lib/environment' )
78
@@ -64,7 +65,7 @@ const fs = require('fs')
6465patchFs ( fs )
6566
6667// override tty if we're being forced to
67- require ( './lib/util/tty' ) . override ( )
68+ overrideTty ( )
6869
6970if ( process . env . CY_NET_PROFILE && isRunningElectron ) {
7071 const netProfiler = require ( './lib/util/net_profiler' ) ( )
Original file line number Diff line number Diff line change 1- require ( '../../spec_helper' )
2-
3- const tty = require ( 'tty' )
4- const ttyUtil = require ( `../../../lib/util/tty` )
5- const terminalSize = require ( `../../../lib/util/terminal-size` )
1+ import tty from 'tty'
2+ import * as ttyUtil from '../../../lib/util/tty'
3+ import * as terminalSize from '../../../lib/util/terminal-size'
64
75const ttys = [ process . stdin . isTTY , process . stdout . isTTY , process . stderr . isTTY ]
86
You can’t perform that action at this time.
0 commit comments