Skip to content

Commit 62359b0

Browse files
solved UTF-8 with Clipboardy
1 parent d3ef01e commit 62359b0

File tree

5 files changed

+679
-580
lines changed

5 files changed

+679
-580
lines changed

extension.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// Evaluate a Hy form (S-expression) in Jupyter notebook
33
// Jupyter notebook must be open in browser, active code cell must be selected
44
// Extension logic pilfered substantially from https://github.com/nachocab/vscode-run-external and https://github.com/dbankier/vscode-quick-select
5-
6-
// FIX: UTF-8
5+
// Depends on Clipboardy: https://github.com/sindresorhus/clipboardy
76

87
const vscode = require('vscode');
98
const { exec } = require('child_process');
9+
const clipboardy = require('clipboardy');
1010

1111
const open_paren = "(";
1212
const close_paren = ")";
@@ -153,10 +153,9 @@ function activate(context) {
153153

154154
const browser = vscode.workspace.getConfiguration("hy-jupyter").get("browser");
155155

156-
// TODO: UTF-8
157156
if (textToPaste.length != 0) {
157+
clipboardy.writeSync(textToPaste)
158158
const command =
159-
`echo -n "${textToPaste}" | pbcopy; ` +
160159
` osascript ` +
161160
` -e 'activate application "${browser}"' ` +
162161
` -e 'tell application "System Events"' ` +

hy-jupyter-0.4.1.vsix

-558 KB
Binary file not shown.
558 KB
Binary file not shown.

0 commit comments

Comments
 (0)