Skip to content

Commit

Permalink
Default to xterm-pty
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Jun 16, 2024
1 parent 0f1fedc commit 9596530
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import irb_head_wasm from "../node_modules/@ruby/head-wasm-wasi/dist/ruby.debug+

function makeTerminal() {
const query = new URLSearchParams(window.location.search);
const key = query.get("FEATURE_TERMINAL") || (
query.get("FEATURE_XTERM_RELINE") === "1" ? "xterm" : "jquery-terminal"
)
switch (key) {
case "xterm":
return makeXTermTerminal();
case "xterm-pty":
return makeXtermPtyTerminal();
case "jquery-terminal":
default:
return makeJQueryTerminal();
const defaultTerminal = "xterm-pty";
const key = query.get("FEATURE_TERMINAL") || defaultTerminal;
const terminals = {
"xterm": makeXTermTerminal,
"xterm-pty": makeXtermPtyTerminal,
"jquery-terminal": makeJQueryTerminal,
}
if (terminals[key]) {
return terminals[key]();
}
// If invalid terminal key is provided, fallback to default terminal
return terminals[defaultTerminal]();
}

const rubyVersions = { "3.3": irb_3_3_wasm, "head": irb_head_wasm };
Expand Down

1 comment on commit 9596530

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for irb-wasm ready!

✅ Preview
https://irb-wasm-ddn6mxphh-yuta-saitos-projects-9b4a9562.vercel.app

Built with commit 9596530.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.