Skip to content

Commit 90392cb

Browse files
committed
fix: trim space after input via IME in cli
1 parent d0e8648 commit 90392cb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

frontend/src/components/content_value/ContentCli.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FitAddon } from 'xterm-addon-fit'
44
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
55
import 'xterm/css/xterm.css'
66
import { EventsEmit, EventsOff, EventsOn } from 'wailsjs/runtime/runtime.js'
7-
import { get, isEmpty, set } from 'lodash'
7+
import { get, isEmpty, set, size, trim } from 'lodash'
88
import { CloseCli, StartCli } from 'wailsjs/go/services/cliService.js'
99
import usePreferencesStore from 'stores/preferences.js'
1010
import { i18nGlobal } from '@/utils/i18n.js'
@@ -188,6 +188,11 @@ const onTermData = (data) => {
188188
return
189189
}
190190
}
191+
192+
// trim space prefix and suffix, it may be input via IME
193+
if (size(data) > 1) {
194+
data = trim(data)
195+
}
191196
updateInput(data)
192197
}
193198
}

0 commit comments

Comments
 (0)