jupyterlab_terminal_cpr_escape_fix 0.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -0
- package/README.md +36 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +13 -0
- package/package.json +210 -0
- package/src/__tests__/jupyterlab_terminal_cpr_escape_fix.spec.ts +9 -0
- package/src/index.ts +21 -0
- package/style/base.css +5 -0
- package/style/index.css +1 -0
- package/style/index.js +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Stellars Henson
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# jupyterlab_terminal_cpr_escape_fix
|
|
2
|
+
|
|
3
|
+
[](https://github.com/stellarshenson/jupyterlab_terminal_cpr_escape_fix/actions/workflows/build.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/jupyterlab_terminal_cpr_escape_fix)
|
|
5
|
+
[](https://pypi.org/project/jupyterlab-terminal-cpr-escape-fix/)
|
|
6
|
+
[](https://pepy.tech/project/jupyterlab-terminal-cpr-escape-fix)
|
|
7
|
+
[](https://jupyterlab.readthedocs.io/en/stable/)
|
|
8
|
+
[](https://kolomolo.com)
|
|
9
|
+
[](https://www.paypal.com/donate/?hosted_button_id=B4KPBJDLLXTSA)
|
|
10
|
+
|
|
11
|
+
> [!WARNING]
|
|
12
|
+
> This extension provides a workaround for a known JupyterLab/terminado issue. It will be deprecated once JupyterLab addresses this problem in a GA release. Monitor the upstream issue tracker for official fixes.
|
|
13
|
+
|
|
14
|
+
Fix the JupyterLab terminado issue where returning to an idle terminal causes cursor position report (CPR) escape sequences to appear as literal text.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- **CPR escape sequence handling** - Intercepts and processes CPR sequences that would otherwise appear as `^[[6n` or similar garbage text
|
|
19
|
+
- **Server-side processing** - Python backend handles terminal state management
|
|
20
|
+
- **Automatic activation** - Extension activates on JupyterLab startup with no configuration required
|
|
21
|
+
|
|
22
|
+
## Requirements
|
|
23
|
+
|
|
24
|
+
- JupyterLab >= 4.0.0
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install jupyterlab_terminal_cpr_escape_fix
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Uninstall
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip uninstall jupyterlab_terminal_cpr_escape_fix
|
|
36
|
+
```
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
2
|
+
/**
|
|
3
|
+
* Plugin that confirms the CPR filter extension is active.
|
|
4
|
+
* The actual filtering happens server-side in the Python extension.
|
|
5
|
+
*/
|
|
6
|
+
declare const plugin: JupyterFrontEndPlugin<void>;
|
|
7
|
+
export default plugin;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin that confirms the CPR filter extension is active.
|
|
3
|
+
* The actual filtering happens server-side in the Python extension.
|
|
4
|
+
*/
|
|
5
|
+
const plugin = {
|
|
6
|
+
id: 'jupyterlab_terminal_cpr_escape_fix:plugin',
|
|
7
|
+
description: 'Fix CPR escape sequences in idle terminal reconnections',
|
|
8
|
+
autoStart: true,
|
|
9
|
+
activate: (app) => {
|
|
10
|
+
console.log('JupyterLab extension jupyterlab_terminal_cpr_escape_fix is activated!');
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export default plugin;
|
package/package.json
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jupyterlab_terminal_cpr_escape_fix",
|
|
3
|
+
"version": "0.9.8",
|
|
4
|
+
"description": "Fix to the jupyterlab terminado issue that when returning to an idle JupyterLab terminal, cursor position report (CPR) escape sequences appear as literal text",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"jupyter",
|
|
7
|
+
"jupyterlab",
|
|
8
|
+
"jupyterlab-extension"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/stellarshenson/jupyterlab_terminal_cpr_escape_fix",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/stellarshenson/jupyterlab_terminal_cpr_escape_fix/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "BSD-3-Clause",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "Stellars Henson",
|
|
17
|
+
"email": "konrad.jelen@gmail.com"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
|
|
21
|
+
"style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
|
|
22
|
+
"src/**/*.{ts,tsx}"
|
|
23
|
+
],
|
|
24
|
+
"main": "lib/index.js",
|
|
25
|
+
"types": "lib/index.d.ts",
|
|
26
|
+
"style": "style/index.css",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/stellarshenson/jupyterlab_terminal_cpr_escape_fix.git"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "jlpm build:lib && jlpm build:labextension:dev",
|
|
33
|
+
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
|
|
34
|
+
"build:labextension": "jupyter labextension build .",
|
|
35
|
+
"build:labextension:dev": "jupyter labextension build --development True .",
|
|
36
|
+
"build:lib": "tsc --sourceMap",
|
|
37
|
+
"build:lib:prod": "tsc",
|
|
38
|
+
"clean": "jlpm clean:lib",
|
|
39
|
+
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
|
|
40
|
+
"clean:lintcache": "rimraf .eslintcache .stylelintcache",
|
|
41
|
+
"clean:labextension": "rimraf jupyterlab_terminal_cpr_escape_fix/labextension jupyterlab_terminal_cpr_escape_fix/_version.py",
|
|
42
|
+
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
|
|
43
|
+
"eslint": "jlpm eslint:check --fix",
|
|
44
|
+
"eslint:check": "eslint . --cache --ext .ts,.tsx",
|
|
45
|
+
"install:extension": "jlpm build",
|
|
46
|
+
"lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
|
|
47
|
+
"lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
|
|
48
|
+
"prettier": "jlpm prettier:base --write --list-different",
|
|
49
|
+
"prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
|
|
50
|
+
"prettier:check": "jlpm prettier:base --check",
|
|
51
|
+
"stylelint": "jlpm stylelint:check --fix",
|
|
52
|
+
"stylelint:check": "stylelint --cache \"style/**/*.css\"",
|
|
53
|
+
"test": "jest --coverage",
|
|
54
|
+
"watch": "run-p watch:src watch:labextension",
|
|
55
|
+
"watch:src": "tsc -w --sourceMap",
|
|
56
|
+
"watch:labextension": "jupyter labextension watch ."
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@jupyterlab/application": "^4.0.0",
|
|
60
|
+
"@jupyterlab/coreutils": "^6.0.0",
|
|
61
|
+
"@jupyterlab/services": "^7.0.0"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@jupyterlab/builder": "^4.0.0",
|
|
65
|
+
"@jupyterlab/testutils": "^4.0.0",
|
|
66
|
+
"@types/jest": "^29.2.0",
|
|
67
|
+
"@types/json-schema": "^7.0.11",
|
|
68
|
+
"@types/react": "^18.0.26",
|
|
69
|
+
"@types/react-addons-linked-state-mixin": "^0.14.22",
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^6.1.0",
|
|
71
|
+
"@typescript-eslint/parser": "^6.1.0",
|
|
72
|
+
"css-loader": "^6.7.1",
|
|
73
|
+
"eslint": "^8.36.0",
|
|
74
|
+
"eslint-config-prettier": "^8.8.0",
|
|
75
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
76
|
+
"jest": "^29.2.0",
|
|
77
|
+
"mkdirp": "^1.0.3",
|
|
78
|
+
"npm-run-all2": "^7.0.1",
|
|
79
|
+
"prettier": "^3.0.0",
|
|
80
|
+
"rimraf": "^5.0.10",
|
|
81
|
+
"source-map-loader": "^1.0.2",
|
|
82
|
+
"style-loader": "^3.3.1",
|
|
83
|
+
"stylelint": "^15.10.1",
|
|
84
|
+
"stylelint-config-recommended": "^13.0.0",
|
|
85
|
+
"stylelint-config-standard": "^34.0.0",
|
|
86
|
+
"stylelint-csstree-validator": "^3.0.0",
|
|
87
|
+
"stylelint-prettier": "^4.0.0",
|
|
88
|
+
"typescript": "~5.5.4",
|
|
89
|
+
"yjs": "^13.5.0"
|
|
90
|
+
},
|
|
91
|
+
"resolutions": {
|
|
92
|
+
"lib0": "0.2.111"
|
|
93
|
+
},
|
|
94
|
+
"sideEffects": [
|
|
95
|
+
"style/*.css",
|
|
96
|
+
"style/index.js"
|
|
97
|
+
],
|
|
98
|
+
"styleModule": "style/index.js",
|
|
99
|
+
"publishConfig": {
|
|
100
|
+
"access": "public"
|
|
101
|
+
},
|
|
102
|
+
"jupyterlab": {
|
|
103
|
+
"discovery": {
|
|
104
|
+
"server": {
|
|
105
|
+
"managers": [
|
|
106
|
+
"pip"
|
|
107
|
+
],
|
|
108
|
+
"base": {
|
|
109
|
+
"name": "jupyterlab_terminal_cpr_escape_fix"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"extension": true,
|
|
114
|
+
"outputDir": "jupyterlab_terminal_cpr_escape_fix/labextension"
|
|
115
|
+
},
|
|
116
|
+
"eslintIgnore": [
|
|
117
|
+
"node_modules",
|
|
118
|
+
"dist",
|
|
119
|
+
"coverage",
|
|
120
|
+
"**/*.d.ts",
|
|
121
|
+
"tests",
|
|
122
|
+
"**/__tests__",
|
|
123
|
+
"ui-tests"
|
|
124
|
+
],
|
|
125
|
+
"eslintConfig": {
|
|
126
|
+
"extends": [
|
|
127
|
+
"eslint:recommended",
|
|
128
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
129
|
+
"plugin:@typescript-eslint/recommended",
|
|
130
|
+
"plugin:prettier/recommended"
|
|
131
|
+
],
|
|
132
|
+
"parser": "@typescript-eslint/parser",
|
|
133
|
+
"parserOptions": {
|
|
134
|
+
"project": "tsconfig.json",
|
|
135
|
+
"sourceType": "module"
|
|
136
|
+
},
|
|
137
|
+
"plugins": [
|
|
138
|
+
"@typescript-eslint"
|
|
139
|
+
],
|
|
140
|
+
"rules": {
|
|
141
|
+
"@typescript-eslint/naming-convention": [
|
|
142
|
+
"error",
|
|
143
|
+
{
|
|
144
|
+
"selector": "interface",
|
|
145
|
+
"format": [
|
|
146
|
+
"PascalCase"
|
|
147
|
+
],
|
|
148
|
+
"custom": {
|
|
149
|
+
"regex": "^I[A-Z]",
|
|
150
|
+
"match": true
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"@typescript-eslint/no-unused-vars": [
|
|
155
|
+
"warn",
|
|
156
|
+
{
|
|
157
|
+
"args": "none"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
161
|
+
"@typescript-eslint/no-namespace": "off",
|
|
162
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
163
|
+
"@typescript-eslint/quotes": [
|
|
164
|
+
"error",
|
|
165
|
+
"single",
|
|
166
|
+
{
|
|
167
|
+
"avoidEscape": true,
|
|
168
|
+
"allowTemplateLiterals": false
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"curly": [
|
|
172
|
+
"error",
|
|
173
|
+
"all"
|
|
174
|
+
],
|
|
175
|
+
"eqeqeq": "error",
|
|
176
|
+
"prefer-arrow-callback": "error"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"prettier": {
|
|
180
|
+
"singleQuote": true,
|
|
181
|
+
"trailingComma": "none",
|
|
182
|
+
"arrowParens": "avoid",
|
|
183
|
+
"endOfLine": "auto",
|
|
184
|
+
"overrides": [
|
|
185
|
+
{
|
|
186
|
+
"files": "package.json",
|
|
187
|
+
"options": {
|
|
188
|
+
"tabWidth": 4
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
"stylelint": {
|
|
194
|
+
"extends": [
|
|
195
|
+
"stylelint-config-recommended",
|
|
196
|
+
"stylelint-config-standard",
|
|
197
|
+
"stylelint-prettier/recommended"
|
|
198
|
+
],
|
|
199
|
+
"plugins": [
|
|
200
|
+
"stylelint-csstree-validator"
|
|
201
|
+
],
|
|
202
|
+
"rules": {
|
|
203
|
+
"csstree/validator": true,
|
|
204
|
+
"property-no-vendor-prefix": null,
|
|
205
|
+
"selector-class-pattern": "^([a-z][A-z\\d]*)(-[A-z\\d]+)*$",
|
|
206
|
+
"selector-no-vendor-prefix": null,
|
|
207
|
+
"value-no-vendor-prefix": null
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
JupyterFrontEnd,
|
|
3
|
+
JupyterFrontEndPlugin
|
|
4
|
+
} from '@jupyterlab/application';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Plugin that confirms the CPR filter extension is active.
|
|
8
|
+
* The actual filtering happens server-side in the Python extension.
|
|
9
|
+
*/
|
|
10
|
+
const plugin: JupyterFrontEndPlugin<void> = {
|
|
11
|
+
id: 'jupyterlab_terminal_cpr_escape_fix:plugin',
|
|
12
|
+
description: 'Fix CPR escape sequences in idle terminal reconnections',
|
|
13
|
+
autoStart: true,
|
|
14
|
+
activate: (app: JupyterFrontEnd) => {
|
|
15
|
+
console.log(
|
|
16
|
+
'JupyterLab extension jupyterlab_terminal_cpr_escape_fix is activated!'
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default plugin;
|
package/style/base.css
ADDED
package/style/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url('base.css');
|
package/style/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './base.css';
|