On Feb 25, 2014, at 2:04 PM, Laszlo Ersek <[email protected]> wrote:
> The
>
> CSI Ps ; Ps ; Ps t
>
> escape sequence serves for window manipulation. We can use the
>
> CSI 8 ; <rows> ; <columns> t
>
> sequence to adapt eg. the xterm window size to the selected console mode.
>
> Reference: <http://rtfm.etla.org/xterm/ctlseq.html>
>
Laszlo Xterm != PCANSI. So I’m don't think this is safe to do this you have a
real PCANSI terminal emulation running.
There are a lot of similarities between VT100/PCANSI/VTUTF8 and xterm, but they
are not the same. So things can kind of seem like there working, but they are
not really 100% functional.
From mucking about in the past I seem to remember:
1) xterm (well at least the xterm-256 color, default for the Mac Terminal.app)
is UTF-8, For the output stuff you can mostly use VTUTF8Type.
2) It is like VT100, but with differences.
INSERT/DELETE/END/PAGE_UP/PAGE_DOWN, and Function Keys,
3) There are some different state machine constructs: ESC [ 1 * ~, ESC [ 2 * ~,
ESC [ 3 * ~, needed for function keys > F4.
4) You can add a GUIDed device path for the terminal emulation type.
This feature seems to scoped to Xterm, not a PCANSI terminal.
s ; P s t
Window manipulation (from dtterm, as well as extensions). These controls may be
disabled using the allowWindowOps resource. Valid values for the first (and any
additional parameters) are:
P s = 1 → De-iconify window.
P s = 2 → Iconify window.
P s = 3 ; x ; y → Move window to [x, y].
P s = 4 ; height ; width → Resize the xterm window to given height and width in
pixels. Omitted parameters reuse the current height or width. Zero parameters
use the display’s height or width.
P s = 5 → Raise the xterm window to the front of the stacking order.
P s = 6 → Lower the xterm window to the bottom of the stacking order.
P s = 7 → Refresh the xterm window.
P s = 8 ; height ; width → Resize the text area to given height and width in
characters. Omitted parameters reuse the current height or width. Zero
parameters use the display’s height or width.
Thanks,
Andrew Fish
> Suggested-by: Andrew Fish <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek <[email protected]>
> ---
> .../Universal/Console/TerminalDxe/TerminalDxe.inf | 1 +
> .../Universal/Console/TerminalDxe/TerminalConOut.c | 30 ++++++++++++++++++++++
> 2 files changed, 31 insertions(+)
>
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> index d4bd55b..eb1c760 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> @@ -58,6 +58,7 @@
> DebugLib
> PcdLib
> BaseLib
> + PrintLib
>
> [Guids]
> gEfiGlobalVariableGuid ## SOMETIMES_CONSUMES ##
> Variable:L"ErrOutDev"
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> index affb3ae..ed13e51 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> @@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
>
> **/
>
> +#include <Library/PrintLib.h>
> +
> #include "Terminal.h"
>
> //
> @@ -84,6 +86,16 @@ CHAR16 mClearScreenString[] = { ESC, '[', '2', 'J',
> 0 };
> CHAR16 mSetCursorPositionString[] = { ESC, '[', '0', '0', ';', '0', '0',
> 'H', 0 };
>
> //
> +// Note that this is an ASCII format string, taking two INT32 arguments:
> +// rows, columns.
> +//
> +// A %d (INT32) format specification can expand to at most 11 characters.
> +//
> +CHAR8 mResizeTextAreaFormatString[] = "\x1B[8;%d;%dt";
> +#define RESIZE_SEQ_SIZE (sizeof mResizeTextAreaFormatString + 2 * (11 - 2))
> +
> +
> +//
> // Body of the ConOut functions
> //
>
> @@ -477,6 +489,24 @@ TerminalConOutSetMode (
> return EFI_DEVICE_ERROR;
> }
>
> + if (TerminalDevice->TerminalType == PCANSITYPE) {
> + CHAR16 ResizeSequence[RESIZE_SEQ_SIZE];
> +
> + UnicodeSPrintAsciiFormat (
> + ResizeSequence,
> + sizeof ResizeSequence,
> + mResizeTextAreaFormatString,
> + (INT32) TerminalDevice->TerminalConsoleModeData[ModeNumber].Rows,
> + (INT32) TerminalDevice->TerminalConsoleModeData[ModeNumber].Columns
> + );
> + TerminalDevice->OutputEscChar = TRUE;
> + Status = This->OutputString (This,
> ResizeSequence);
> + TerminalDevice->OutputEscChar = FALSE;
> + if (EFI_ERROR (Status)) {
> + return EFI_DEVICE_ERROR;
> + }
> + }
> +
> This->Mode->Mode = (INT32) ModeNumber;
>
> Status = This->ClearScreen (This);
> --
> 1.8.3.1
>
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel