mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
Compare commits
5 Commits
dependabot
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b499667cbb | ||
|
|
1d596e18df | ||
|
|
6f95033009 | ||
|
|
1f08af6575 | ||
|
|
071a091347 |
@@ -21,7 +21,7 @@ plugins {
|
|||||||
|
|
||||||
|
|
||||||
group = "app.termora"
|
group = "app.termora"
|
||||||
version = "1.0.16"
|
version = "1.0.17"
|
||||||
|
|
||||||
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
|
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
|
||||||
val arch: ArchitectureInternal = DefaultNativePlatform.getCurrentArchitecture()
|
val arch: ArchitectureInternal = DefaultNativePlatform.getCurrentArchitecture()
|
||||||
@@ -141,10 +141,6 @@ application {
|
|||||||
|
|
||||||
args.add("-Dapp-version=${project.version}")
|
args.add("-Dapp-version=${project.version}")
|
||||||
|
|
||||||
if (os.isLinux) {
|
|
||||||
args.add("-Dsun.java2d.opengl=true")
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationDefaultJvmArgs = args
|
applicationDefaultJvmArgs = args
|
||||||
mainClass = "app.termora.MainKt"
|
mainClass = "app.termora.MainKt"
|
||||||
}
|
}
|
||||||
@@ -392,10 +388,6 @@ tasks.register<Exec>("jpackage") {
|
|||||||
options.add("--add-exports java.desktop/com.apple.eawt=ALL-UNNAMED")
|
options.add("--add-exports java.desktop/com.apple.eawt=ALL-UNNAMED")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (os.isLinux) {
|
|
||||||
options.add("-Dsun.java2d.opengl=true")
|
|
||||||
}
|
|
||||||
|
|
||||||
val arguments = mutableListOf("${Jvm.current().javaHome}/bin/jpackage")
|
val arguments = mutableListOf("${Jvm.current().javaHome}/bin/jpackage")
|
||||||
arguments.addAll(listOf("--runtime-image", "${buildDir}/jlink"))
|
arguments.addAll(listOf("--runtime-image", "${buildDir}/jlink"))
|
||||||
arguments.addAll(listOf("--name", project.name.uppercaseFirstChar()))
|
arguments.addAll(listOf("--name", project.name.uppercaseFirstChar()))
|
||||||
|
|||||||
@@ -355,7 +355,27 @@ class ApplicationRunner {
|
|||||||
.event(getAnalyticsUserID(), "launch", properties)
|
.event(getAnalyticsUserID(), "launch", properties)
|
||||||
val delivery = ClientDelivery()
|
val delivery = ClientDelivery()
|
||||||
delivery.addMessage(message)
|
delivery.addMessage(message)
|
||||||
MixpanelAPI().deliver(delivery, true)
|
val endpoints = listOf(
|
||||||
|
"https://api-eu.mixpanel.com",
|
||||||
|
"https://api-in.mixpanel.com",
|
||||||
|
"https://api.mixpanel.com",
|
||||||
|
"http://api.mixpanel.com",
|
||||||
|
)
|
||||||
|
for (endpoint in endpoints) {
|
||||||
|
try {
|
||||||
|
MixpanelAPI(
|
||||||
|
"$endpoint/track",
|
||||||
|
"$endpoint/engage",
|
||||||
|
"$endpoint/groups"
|
||||||
|
).deliver(delivery, true)
|
||||||
|
break
|
||||||
|
} catch (e: Exception) {
|
||||||
|
if (log.isErrorEnabled) {
|
||||||
|
log.error(e.message, e)
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
if (log.isErrorEnabled) {
|
if (log.isErrorEnabled) {
|
||||||
log.error(e.message, e)
|
log.error(e.message, e)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class TermoraFrameManager : Disposable {
|
|||||||
|
|
||||||
fun createWindow(): TermoraFrame {
|
fun createWindow(): TermoraFrame {
|
||||||
val frame = TermoraFrame().apply { registerCloseCallback(this) }
|
val frame = TermoraFrame().apply { registerCloseCallback(this) }
|
||||||
frame.title = if (SystemInfo.isLinux) null else Application.getName()
|
frame.title = Application.getName()
|
||||||
frame.defaultCloseOperation = DO_NOTHING_ON_CLOSE
|
frame.defaultCloseOperation = DO_NOTHING_ON_CLOSE
|
||||||
|
|
||||||
val rectangle = getFrameRectangle() ?: FrameRectangle(-1, -1, 1280, 800, 0)
|
val rectangle = getFrameRectangle() ?: FrameRectangle(-1, -1, 1280, 800, 0)
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ class TerminalCopyAction : AnAction() {
|
|||||||
|
|
||||||
override fun actionPerformed(evt: AnActionEvent) {
|
override fun actionPerformed(evt: AnActionEvent) {
|
||||||
val terminalPanel = evt.getData(DataProviders.TerminalPanel) ?: return
|
val terminalPanel = evt.getData(DataProviders.TerminalPanel) ?: return
|
||||||
|
val selectionModel = terminalPanel.terminal.getSelectionModel()
|
||||||
|
if (!selectionModel.hasSelection()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
val text = terminalPanel.copy()
|
val text = terminalPanel.copy()
|
||||||
val systemClipboard = terminalPanel.toolkit.systemClipboard
|
val systemClipboard = terminalPanel.toolkit.systemClipboard
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package app.termora.terminal.panel
|
package app.termora.terminal.panel
|
||||||
|
|
||||||
|
import app.termora.actions.TerminalCopyAction
|
||||||
import app.termora.keymap.KeyShortcut
|
import app.termora.keymap.KeyShortcut
|
||||||
import app.termora.keymap.KeymapManager
|
import app.termora.keymap.KeymapManager
|
||||||
import app.termora.terminal.ControlCharacters
|
import app.termora.terminal.ControlCharacters
|
||||||
@@ -69,6 +70,7 @@ class TerminalPanelKeyAdapter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val keyStroke = KeyStroke.getKeyStrokeForEvent(e)
|
val keyStroke = KeyStroke.getKeyStrokeForEvent(e)
|
||||||
|
val keymapActions = activeKeymap.getActionIds(KeyShortcut(keyStroke))
|
||||||
for (action in terminalPanel.getTerminalActions()) {
|
for (action in terminalPanel.getTerminalActions()) {
|
||||||
if (action.test(keyStroke, e)) {
|
if (action.test(keyStroke, e)) {
|
||||||
action.actionPerformed(e)
|
action.actionPerformed(e)
|
||||||
@@ -100,7 +102,9 @@ class TerminalPanelKeyAdapter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 如果命中了全局快捷键,那么不处理
|
// 如果命中了全局快捷键,那么不处理
|
||||||
if (keyStroke.modifiers != 0 && activeKeymap.getActionIds(KeyShortcut(keyStroke)).isNotEmpty()) {
|
val copyShortcutWithoutSelection =
|
||||||
|
keymapActions.contains(TerminalCopyAction.COPY) && terminal.getSelectionModel().hasSelection().not()
|
||||||
|
if (keyStroke.modifiers != 0 && keymapActions.isNotEmpty() && !copyShortcutWithoutSelection) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user