@mjasano/devtunnel 1.5.1 → 1.5.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.5.2] - 2026-01-02
9
+
10
+ ### Fixed
11
+ - Korean (Hangul) IME input on mobile - use dedicated input field for proper composition handling
12
+
8
13
  ## [1.5.1] - 2026-01-02
9
14
 
10
15
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjasano/devtunnel",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Web terminal with code editor and tunnel manager - access your dev environment from anywhere",
5
5
  "main": "server.js",
6
6
  "bin": {
package/public/app.js CHANGED
@@ -629,16 +629,73 @@ term.loadAddon(webLinksAddon);
629
629
  term.open(terminalContainer);
630
630
  fitAddon.fit();
631
631
 
632
- // IME 한글 입력 처리
632
+ // 모바일 IME 한글 입력 처리
633
633
  let isComposing = false;
634
- const xtermTextarea = terminalContainer.querySelector('.xterm-helper-textarea');
635
- if (xtermTextarea) {
636
- xtermTextarea.addEventListener('compositionstart', () => {
637
- isComposing = true;
638
- });
634
+ let isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
635
+
636
+ // 모바일용 숨겨진 입력 필드 생성
637
+ const mobileInput = document.createElement('input');
638
+ mobileInput.type = 'text';
639
+ mobileInput.autocapitalize = 'off';
640
+ mobileInput.autocomplete = 'off';
641
+ mobileInput.autocorrect = 'off';
642
+ mobileInput.spellcheck = false;
643
+ mobileInput.style.cssText = `
644
+ position: absolute;
645
+ left: -9999px;
646
+ top: 0;
647
+ width: 1px;
648
+ height: 1px;
649
+ opacity: 0;
650
+ z-index: -1;
651
+ `;
652
+ terminalContainer.appendChild(mobileInput);
653
+
654
+ mobileInput.addEventListener('compositionstart', () => {
655
+ isComposing = true;
656
+ });
657
+
658
+ mobileInput.addEventListener('compositionend', (e) => {
659
+ isComposing = false;
660
+ if (e.data && ws && ws.readyState === WebSocket.OPEN) {
661
+ ws.send(JSON.stringify({ type: 'input', data: e.data }));
662
+ }
663
+ mobileInput.value = '';
664
+ });
665
+
666
+ mobileInput.addEventListener('input', (e) => {
667
+ // 조합 중이 아닐 때만 전송 (영문, 숫자 등)
668
+ if (!isComposing && e.data && ws && ws.readyState === WebSocket.OPEN) {
669
+ ws.send(JSON.stringify({ type: 'input', data: e.data }));
670
+ mobileInput.value = '';
671
+ }
672
+ });
673
+
674
+ mobileInput.addEventListener('keydown', (e) => {
675
+ // 특수키 처리 (Enter, Backspace, Arrow 등)
676
+ if (!isComposing) {
677
+ let data = null;
678
+ switch (e.key) {
679
+ case 'Enter': data = '\r'; break;
680
+ case 'Backspace': data = '\x7f'; break;
681
+ case 'Tab': data = '\t'; e.preventDefault(); break;
682
+ case 'Escape': data = '\x1b'; break;
683
+ case 'ArrowUp': data = '\x1b[A'; break;
684
+ case 'ArrowDown': data = '\x1b[B'; break;
685
+ case 'ArrowRight': data = '\x1b[C'; break;
686
+ case 'ArrowLeft': data = '\x1b[D'; break;
687
+ }
688
+ if (data && ws && ws.readyState === WebSocket.OPEN) {
689
+ ws.send(JSON.stringify({ type: 'input', data }));
690
+ if (e.key !== 'Tab') mobileInput.value = '';
691
+ }
692
+ }
693
+ });
639
694
 
640
- xtermTextarea.addEventListener('compositionend', (e) => {
641
- isComposing = false;
695
+ // 모바일에서 터미널 클릭 시 숨겨진 입력 필드에 포커스
696
+ if (isMobile) {
697
+ terminalContainer.addEventListener('click', () => {
698
+ mobileInput.focus();
642
699
  });
643
700
  }
644
701
 
@@ -958,8 +1015,8 @@ function connect() {
958
1015
  }
959
1016
 
960
1017
  term.onData((data) => {
961
- // IME 조합 중이면 무시 (xterm이 compositionend 후 자동 처리)
962
- if (isComposing) return;
1018
+ // 모바일에서는 mobileInput으로 처리
1019
+ if (isMobile) return;
963
1020
 
964
1021
  if (ws && ws.readyState === WebSocket.OPEN) {
965
1022
  ws.send(JSON.stringify({ type: 'input', data }));