mirror of https://github.com/adamdruppe/arsd.git
terminal tweaks
This commit is contained in:
parent
32b4921875
commit
069d318482
21
terminal.d
21
terminal.d
|
@ -9579,6 +9579,9 @@ auto SdpyIntegratedKeys(SimpleWindow)(SimpleWindow window) {
|
|||
terminal = new Terminal(ConsoleOutputType.linear);
|
||||
rtti = new RealTimeConsoleInput(terminal, ConsoleInputFlags.releasedKeys);
|
||||
listener = rtti.integrateWithSimpleDisplayEventLoop(delegate(InputEvent ie) {
|
||||
if(ie.type == InputEvent.Type.HangupEvent || ie.type == InputEvent.Type.EndOfFileEvent)
|
||||
disconnect();
|
||||
|
||||
if(ie.type != InputEvent.Type.KeyboardEvent)
|
||||
return;
|
||||
auto kbd = ie.get!(InputEvent.Type.KeyboardEvent);
|
||||
|
@ -9664,13 +9667,25 @@ auto SdpyIntegratedKeys(SimpleWindow)(SimpleWindow window) {
|
|||
}
|
||||
});
|
||||
}
|
||||
~this() {
|
||||
|
||||
void disconnect() {
|
||||
if(listener is null)
|
||||
return;
|
||||
listener.dispose();
|
||||
.destroy(*rtti);
|
||||
.destroy(*terminal);
|
||||
listener = null;
|
||||
try {
|
||||
.destroy(*rtti);
|
||||
.destroy(*terminal);
|
||||
} catch(Exception e) {
|
||||
|
||||
}
|
||||
rtti = null;
|
||||
terminal = null;
|
||||
}
|
||||
|
||||
~this() {
|
||||
disconnect();
|
||||
}
|
||||
}
|
||||
return impl(window);
|
||||
}
|
||||
|
|
|
@ -2730,6 +2730,7 @@ P s = 2 3 ; 2 → Restore xterm window title from stack.
|
|||
case 'E': cursorY = cursorY + getArgs(1)[0]; cursorX = 0; break;
|
||||
case 'F': cursorY = cursorY - getArgs(1)[0]; cursorX = 0; break;
|
||||
case 'G': cursorX = getArgs(1)[0] - 1; break;
|
||||
case 'f': // wikipedia says it is the same except it is a format func instead of editor func. idk what the diff is
|
||||
case 'H':
|
||||
auto got = getArgs(1, 1);
|
||||
cursorX = got[1] - 1;
|
||||
|
|
Loading…
Reference in New Issue