Terminal-0.9.8/0000755000175000001440000000000011762761137012557 5ustar multixusersTerminal-0.9.8/README0000644000175000001440000001610311324136606013427 0ustar multixusersTerminal.app - copyright (c) 2002 Alexander Malmberg OpenPty and ForkPty replacements written by Riccardo Mottola, 2005-2008 a terminal emulator for GNUstep This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. Installing ---------- You'll need gnustep-base and gnustep-gui (or possibly some other openstep-like system). The pty code is known to work on GNU/Linux and FreeBSD and NetBSD. Pty code replacement is provided and used by default on Solaris, where it is known to work. On other operating systems you might want to define USE_FORKPTY_REPLACEMENT in TerminalView.m Reports and/or patches for other systems are welcome. To build, run 'make'. To install, run 'make install'. (All the usual gnustep-make options apply.) Running ------- Run it just like you'd run any other GNUstep application, eg.: openapp Terminal.app An empty window with a shell will be opened when the program starts, unless you gave it a command on the command line, in which case that command will be run in the opened window. Fonts ----- You can change the fonts used for normal and bold text in the preferences panel. Terminal.app will get the metrics for the character cells from the normal font, so this font really should be a fixed pitch font or things will look messed up. The bold font should closely match the normal font. (Terminal.app assumes that all characters, bold and normal, stay inside the normal font's bounding box. If they don't, there will be visual glitches. However, it is more common that a non-fixed pitch font's bounding box is very large (since it needs to enclose _all_ characters in the font), so that the terminal window will be very wide.) Keys ---- By default, the command key is used to access key equivalents for menu entries, and thus can't be used as a meta key in the terminal. If you have command mapped to the key you want to use as meta, you can enable 'Treat the command key as meta' in the preferences panel. However, this will disable all key equivalents in Terminal.app. The 'proper' solution to this problem is to remap the command key (and possibly alternate key). The alternate key will always be treated as meta. Often, the escape key can be used to emulate a meta key. This means that in some programs, you might have to press escape twice to get a 'real' escape, or there will be a delay before it is handled. The 'Send a double escape...' option causes Terminal.app to send a double escape when you hit the escape key (ie. "\e\e"), which should work better (but you can no longer use the escape key as meta). Terminal services ----------------- Terminal.app can provide services for other applications by piping the selection through arbitrary commands. Services are configured in one of the preferences panel's tabs. The first time you open this tab, a default set of services will be loaded. They are automatically added the first time so that they appear in the services menu. This will also run make_services to update the services list, but it may take up to 30 seconds for running applications to notice the change. The 'Add' and 'Remove' buttons add and remove services. Using the 'Export' button it is possible to save a set of services to a file. These files can be imported using the 'Import' button, so it is possible for users to share terminal services definitions. The extension of the file should be '.svcs'. The default set of services is such a file located in the application wrapper's resource directory. If you import a service with the same name as an existing service, and they aren't identical, the new one will be renamed to avoid a conflict. Name This is the name of the service as it appears in the services menu. By default, terminal services will be placed in a 'Terminal' submenu of the Services menu, but you can override this by giving the name a leading '/'. In this case, you can also use a second '/' to create your own submenus. (gnustep-gui doesn't support submenus of submenus, though.) Names must be unique. Key The key equivalent for this command, if any. Note that if an application uses this key for some other menu entry, the key will activate that menu entry, not the service. Command line The command line. It is passed to /bin/sh, so any shell commands will work, and arguments may have to be quoted. A '%p' in the command line will cause a prompt to be brought up when the service is run. If input is to be placed on the command line, you can mark the place to put it at with '%s' (otherwise it will be appended to the command line). You can use '%%' to get a real '%'. Run in background/new window/idle window If a service is set to run in the background, the command will have to complete before the service will return, and the service can return output. Otherwise, the command's output will appear in a window. 'new window' causes a completely new window to be opened (and it will close automatically when the command is completed if that option is set). 'idle window' causes Terminal.app to try to reuse an existing idle window. If there is no such window it will open a new window (and that window won't close automatically). Ignore/return output (only applies to background services) If set to ignore, the output of the command will be discarded. Otherwise, it will be parsed to a string or a bunch of filenames, depending on the acceptable types. The output is assumed to be utf8 encoded. No input/Input in stdin/Input on command line If set to 'No input', the service won't accept any input. Otherwise it is necessary to select something to run it, and the selection will be either piped to the command ('in stdin') or placed on the service's command line (either at the '%s' or at the end, see above). Input will be sent to the command utf8 encoded. Accept types Plain text will be sent verbatim to the command. A list of filenames (possibly just one) will be sent separated by ' ':s (if on the command line), or newlines (if in stdin). Terminal emulation ------------------ The terminal emulation code is based on Linux's console code, and nearly all parts of it are handled. Thus, the TERM environment variable is set to 'linux'. Additionally, 'vt100', 'vt220', 'xterm', and others similar to these should mostly work. To distinguish Terminal.app from a 'real' linux console, the environment variable TERM_PROGRAM is set to 'GNUstep_Terminal'. The xterm extensions for setting the window's title are also supported. You set the title using: '\033]'+0, 1, or 2+';'+the title+'\007' 1 sets the miniwindow title, 2 sets the window title, and 0 sets both. Example (from Jeff Teunissen): export PROMPT_COMMAND='echo -ne "\033]2;Terminal - ${HOSTNAME}:${PWD}\007"' (The terminal emulation code is fairly modular. If you want to write a terminal emulation class for some other terminal, contact me and I'll do the remaining cleanups necessary to load terminal emulation classes from bundles.) Terminal-0.9.8/charmaps.h0000644000175000001440000002166311016341203014512 0ustar multixusers#define GRAF_MAP 1 #define LAT1_MAP 0 #define IBMPC_MAP 2 #define USER_MAP 3 /* staight from linux/drivers/char/consolemap.c, GNU GPL:ed */ static const unichar translate_maps[4][256]={ /* 8-bit Latin-1 mapped to Unicode -- trivial mapping */ { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff }, /* VT100 graphics mapped to Unicode */ { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x2192, 0x2190, 0x2191, 0x2193, 0x002f, 0x2588, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x00a0, 0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, 0x2591, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0xf800, 0xf801, 0x2500, 0xf803, 0xf804, 0x251c, 0x2524, 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff }, /* IBM Codepage 437 mapped to Unicode */ { 0x0000, 0x263a, 0x263b, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022, 0x25d8, 0x25cb, 0x25d9, 0x2642, 0x2640, 0x266a, 0x266b, 0x263c, 0x25b6, 0x25c0, 0x2195, 0x203c, 0x00b6, 0x00a7, 0x25ac, 0x21a8, 0x2191, 0x2193, 0x2192, 0x2190, 0x221f, 0x2194, 0x25b2, 0x25bc, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x2302, 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5, 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9, 0x00ff, 0x00d6, 0x00dc, 0x00a2, 0x00a3, 0x00a5, 0x20a7, 0x0192, 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba, 0x00bf, 0x2310, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb, 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510, 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f, 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567, 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b, 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580, 0x03b1, 0x00df, 0x0393, 0x03c0, 0x03a3, 0x03c3, 0x00b5, 0x03c4, 0x03a6, 0x0398, 0x03a9, 0x03b4, 0x221e, 0x03c6, 0x03b5, 0x2229, 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, 0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0 }, /* User mapping -- default to codes for direct font mapping */ { 0xf000, 0xf001, 0xf002, 0xf003, 0xf004, 0xf005, 0xf006, 0xf007, 0xf008, 0xf009, 0xf00a, 0xf00b, 0xf00c, 0xf00d, 0xf00e, 0xf00f, 0xf010, 0xf011, 0xf012, 0xf013, 0xf014, 0xf015, 0xf016, 0xf017, 0xf018, 0xf019, 0xf01a, 0xf01b, 0xf01c, 0xf01d, 0xf01e, 0xf01f, 0xf020, 0xf021, 0xf022, 0xf023, 0xf024, 0xf025, 0xf026, 0xf027, 0xf028, 0xf029, 0xf02a, 0xf02b, 0xf02c, 0xf02d, 0xf02e, 0xf02f, 0xf030, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037, 0xf038, 0xf039, 0xf03a, 0xf03b, 0xf03c, 0xf03d, 0xf03e, 0xf03f, 0xf040, 0xf041, 0xf042, 0xf043, 0xf044, 0xf045, 0xf046, 0xf047, 0xf048, 0xf049, 0xf04a, 0xf04b, 0xf04c, 0xf04d, 0xf04e, 0xf04f, 0xf050, 0xf051, 0xf052, 0xf053, 0xf054, 0xf055, 0xf056, 0xf057, 0xf058, 0xf059, 0xf05a, 0xf05b, 0xf05c, 0xf05d, 0xf05e, 0xf05f, 0xf060, 0xf061, 0xf062, 0xf063, 0xf064, 0xf065, 0xf066, 0xf067, 0xf068, 0xf069, 0xf06a, 0xf06b, 0xf06c, 0xf06d, 0xf06e, 0xf06f, 0xf070, 0xf071, 0xf072, 0xf073, 0xf074, 0xf075, 0xf076, 0xf077, 0xf078, 0xf079, 0xf07a, 0xf07b, 0xf07c, 0xf07d, 0xf07e, 0xf07f, 0xf080, 0xf081, 0xf082, 0xf083, 0xf084, 0xf085, 0xf086, 0xf087, 0xf088, 0xf089, 0xf08a, 0xf08b, 0xf08c, 0xf08d, 0xf08e, 0xf08f, 0xf090, 0xf091, 0xf092, 0xf093, 0xf094, 0xf095, 0xf096, 0xf097, 0xf098, 0xf099, 0xf09a, 0xf09b, 0xf09c, 0xf09d, 0xf09e, 0xf09f, 0xf0a0, 0xf0a1, 0xf0a2, 0xf0a3, 0xf0a4, 0xf0a5, 0xf0a6, 0xf0a7, 0xf0a8, 0xf0a9, 0xf0aa, 0xf0ab, 0xf0ac, 0xf0ad, 0xf0ae, 0xf0af, 0xf0b0, 0xf0b1, 0xf0b2, 0xf0b3, 0xf0b4, 0xf0b5, 0xf0b6, 0xf0b7, 0xf0b8, 0xf0b9, 0xf0ba, 0xf0bb, 0xf0bc, 0xf0bd, 0xf0be, 0xf0bf, 0xf0c0, 0xf0c1, 0xf0c2, 0xf0c3, 0xf0c4, 0xf0c5, 0xf0c6, 0xf0c7, 0xf0c8, 0xf0c9, 0xf0ca, 0xf0cb, 0xf0cc, 0xf0cd, 0xf0ce, 0xf0cf, 0xf0d0, 0xf0d1, 0xf0d2, 0xf0d3, 0xf0d4, 0xf0d5, 0xf0d6, 0xf0d7, 0xf0d8, 0xf0d9, 0xf0da, 0xf0db, 0xf0dc, 0xf0dd, 0xf0de, 0xf0df, 0xf0e0, 0xf0e1, 0xf0e2, 0xf0e3, 0xf0e4, 0xf0e5, 0xf0e6, 0xf0e7, 0xf0e8, 0xf0e9, 0xf0ea, 0xf0eb, 0xf0ec, 0xf0ed, 0xf0ee, 0xf0ef, 0xf0f0, 0xf0f1, 0xf0f2, 0xf0f3, 0xf0f4, 0xf0f5, 0xf0f6, 0xf0f7, 0xf0f8, 0xf0f9, 0xf0fa, 0xf0fb, 0xf0fc, 0xf0fd, 0xf0fe, 0xf0ff } }; Terminal-0.9.8/Spanish.lproj/0000755000175000001440000000000011667362252015310 5ustar multixusersTerminal-0.9.8/Spanish.lproj/Localizable.strings0000644000175000001440000001656011016341203021131 0ustar multixusers/* Translation by Manuel Teira. */ /*** Spanish.lproj/Localizable.strings updated by make_strings 2003-08-04 16:35:33 +0200 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:653 */ "Command line:" = "L\u00ednea de comando:"; /* File: TerminalViewPrefs.m:233 */ /* File: TerminalViewPrefs.m:238 */ "Display" = "Pantalla"; /* File: TerminalViewPrefs.m:378 */ /* File: TerminalViewPrefs.m:405 */ "Pick font..." = "Elija fuente..."; /* File: TerminalViewPrefs.m:526 */ /* File: TerminalViewPrefs.m:531 */ "Shell" = "Shell"; /* File: TerminalViewPrefs.m:639 */ /* File: TerminalViewPrefs.m:644 */ "Keyboard" = "Teclado"; /* File: TerminalWindow.m:193 */ /* File: TerminalWindow.m:197 */ " (idle)" = " (terminado)"; /*** Unmatched/untranslated keys ***/ /* File: PreferencesWindowController.m:70 */ "Revert" = "Atr\u00e1s"; /* File: PreferencesWindowController.m:78 */ "Apply and save" = "Aplicar y guardar"; /* File: PreferencesWindowController.m:122 */ "Preferences" = "Preferencias"; /* File: Services.m:60 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "No existe ning\u00fan servicio llamado '%@'.\nSu lista de servicios est\u00e1 probablemente desactualizada.\nEjecute 'make_services' para actualizarla."; /* File: Services.m:152 */ "Service aborted by user." = "Servicio abortado por el usuario."; /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Cancelar"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /* File: ServicesParameterWindowController.m:118 */ "Parameter for service %@" = "Par\u00e1metro para el servicio %@"; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "Servicio sin nombre"; /* File: ServicesPrefs.m:254 */ "Import services" = "Importar servicios"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Error importando servicios"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "El fichero '%@' no contiene servicios de terminal v\u00e1lidos."; /* File: ServicesPrefs.m:401 */ "Export services" = "Exportar servicios"; /* File: ServicesPrefs.m:468 */ "Terminal services" = "Servicios de terminal"; /* File: ServicesPrefs.m:473 */ "Terminal\nservices" = "Servicios"; /* File: ServicesPrefs.m:499 */ "Add" = "A\u00f1adir"; /* File: ServicesPrefs.m:507 */ "Remove" = "Borrar"; /* File: ServicesPrefs.m:515 */ "Import..." = "Importar..."; /* File: ServicesPrefs.m:523 */ "Export..." = "Exportar..."; /* File: ServicesPrefs.m:549 */ "Ignore output" = "Ignorar salida"; /* File: ServicesPrefs.m:550 */ "Return output" = "Devolver salida"; /* File: ServicesPrefs.m:558 */ "No input" = "Sin entrada"; /* File: ServicesPrefs.m:559 */ "Input in stdin" = "Entrada por stdin"; /* File: ServicesPrefs.m:560 */ "Input on command line" = "Entrada por l\u00ednea de comandos"; /* File: ServicesPrefs.m:568 */ "Run in background" = "Ejecutar en segundo plano"; /* File: ServicesPrefs.m:569 */ "Run in new window" = "Ejecutar en otra ventana"; /* File: ServicesPrefs.m:570 */ "Run in idle window" = "Ejecutar en ventana inactiva"; /* File: ServicesPrefs.m:585 */ "Accept types" = "Aceptar tipos"; /* File: ServicesPrefs.m:594 */ "Filenames" = "Nombres de fichero"; /* File: ServicesPrefs.m:602 */ "Plain text" = "Texto plano"; /* File: ServicesPrefs.m:627 */ "Name:" = "Nombre:"; /* File: ServicesPrefs.m:640 */ "Key:" = "Clave:"; /* File: TerminalParser_LinuxPrefs.m:40 */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:41 */ "West Europe, latin1" = "Europa Oeste, latin1"; /* File: TerminalParser_LinuxPrefs.m:42 */ "East Europe, latin2" = "Europa del Este, latin2"; /* File: TerminalParser_LinuxPrefs.m:43 */ "Chinese" = "Chino"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Custom, leave unchanged" = "Personalizado, no cambiar"; /* File: TerminalParser_LinuxPrefs.m:103 */ "'linux' terminal parser" = "Parser de terminal 'linux'"; /* File: TerminalParser_LinuxPrefs.m:108 */ "'linux'\nparser" = "parser\n'linux'"; /* File: TerminalParser_LinuxPrefs.m:151 */ "Character set:" = "Juego de caracteres:"; /* File: TerminalView.m:1487 */ "[Process exited]" = "[Proceso terminado]"; /* File: TerminalView.m:1622 */ "Unable to open pipe for input: %m." = "Error al abrir pipe en entrada: %m."; /* File: TerminalView.m:1634 */ "Unable to fork: %m." = "Error en fork: %m."; /* File: TerminalViewPrefs.m:264 */ "Scroll-back length in lines:" = "L\u00edneas de buffer:"; /* File: TerminalViewPrefs.m:287 */ "Cursor" = "Cursor"; /* File: TerminalViewPrefs.m:292 */ "Style:" = "Estilo:"; /* File: TerminalViewPrefs.m:332 */ "Color:" = "Color:"; /* File: TerminalViewPrefs.m:355 */ "Handle wide (multi-cell) glyphs" = "Manejar glyphs multi-celda"; /* File: TerminalViewPrefs.m:366 */ "Bold font:" = "Fuente negrita:"; /* File: TerminalViewPrefs.m:393 */ "Normal font:" = "Fuente normal:"; /* File: TerminalViewPrefs.m:552 */ "Start as login-shell" = "Arrancar como shell de login"; /* File: TerminalViewPrefs.m:564 */ "Shell:" = "Shell:"; /* File: TerminalViewPrefs.m:669 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Interpretar la tecla de comando como meta.\n\nN\u00f3tese que habilitando esta opci\u00f3n\nno podr\u00e1 acceder al men\u00fa\nutilizando el teclado."; /* File: TerminalViewPrefs.m:684 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "Escape se env\u00eda dos veces.\n\nSignifica que la tecla de escape ser\u00e1\nreconocida m\u00e1s r\u00e1pido por algunos programas,\npero no se podr\u00e1 usar como sustituto de 'meta'."; /* File: TerminalWindowPrefs.m:114 */ "Terminal Window" = "Ventana de terminal"; /* File: TerminalWindowPrefs.m:119 */ "Terminal\nWindow" = "Ventana"; /* File: TerminalWindowPrefs.m:152 */ "Close new windows when idle" = "Cerrar ventanas inactivas"; /* File: TerminalWindowPrefs.m:153 */ "Don't close new windows" = "No cerrar ventanas nuevas"; /* File: TerminalWindowPrefs.m:176 */ "Default size" = "Tama\u00f1o por defecto"; /* File: TerminalWindowPrefs.m:180 */ "Width:" = "Ancho:"; /* File: TerminalWindowPrefs.m:189 */ "Height:" = "Alto:"; /* File: TerminalWindowPrefs.m:212 */ "Add top and bottom border" = "A\u00f1adir bordes superior e inferior"; /* File: main.m:154 */ "Info..." = "Informaci\u00f3n..."; /* File: main.m:156 */ "Preferences..." = "Preferencias..."; /* File: main.m:158 */ "Benchmark" = "Benchmark"; /* File: main.m:160 */ "Info" = "Informaci\u00f3n"; /* File: main.m:172 */ "New terminal" = "Nuevo terminal"; /* File: main.m:178 */ "Cut" = "Cortar"; /* File: main.m:181 */ "Copy" = "Copiar"; /* File: main.m:184 */ "Paste" = "Pegar"; /* File: main.m:187 */ "Edit" = "Editar"; /* File: main.m:192 */ "Close" = "Cerrar"; /* File: main.m:195 */ "Windows" = "Ventanas"; /* File: main.m:200 */ "Services" = "Servicios"; /* File: main.m:204 */ "Hide" = "Ocultar"; /* File: main.m:208 */ "Quit" = "Salir"; /* File: main.m:256 */ "Quit?" = "\u00bfSalir?"; /* File: main.m:257 */ "There are active windows. Quitting will close them." = "Hay ventanas activas. Al salir se cerrar\u00e1n."; /* File: main.m:258 */ "Don't quit" = "No salir"; /* File: main.m:259 */ "Quit anyway" = "Salir de todos modos"; Terminal-0.9.8/German.lproj/0000755000175000001440000000000011667362252015114 5ustar multixusersTerminal-0.9.8/German.lproj/Localizable.strings0000644000175000001440000002014711016341203020731 0ustar multixusers/* German translation by Chris B. Vetter Additions and modifications by Axel Katerbau */ /*** German.lproj/Localizable.strings updated by make_strings 2002-12-09 18:39:09 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:653 */ "Command line:" = "Befehlszeile:"; /* File: TerminalViewPrefs.m:487 */ /* Flag: untranslated */ /* File: TerminalViewPrefs.m:492 */ /* Flag: untranslated */ "Shell" = "Shell"; /* File: TerminalViewPrefs.m:602 */ /* File: TerminalViewPrefs.m:607 */ "Keyboard" = "Tastatur"; /*** Unmatched/untranslated keys ***/ /* File: TerminalParser_LinuxPrefs.m:40 */ /* Flag: untranslated */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:41 */ "West Europe, latin1" = "Westeurop\u00e4isch, latin-1"; /* File: TerminalParser_LinuxPrefs.m:42 */ "East Europe, latin2" = "Osteurop\u00e4isch, latin-2"; /* File: TerminalParser_LinuxPrefs.m:43 */ "Chinese" = "Chinesisch"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Custom, leave unchanged" = "Benutzerdefiniert, unver\u00e4ndert lassen"; /* File: TerminalParser_LinuxPrefs.m:103 */ "'linux' terminal parser" = "'Linux' Terminal Parser"; /* File: TerminalParser_LinuxPrefs.m:108 */ "'linux'\nparser" = "'Linux'\nParser"; /* File: TerminalParser_LinuxPrefs.m:151 */ "Character set:" = "Zeichensatz:"; /* File: TerminalViewPrefs.m:255 */ "Scroll-back length in lines:" = "Anzahl zur\u00fcckrollbarer Zeilen:"; /* File: TerminalViewPrefs.m:319 */ "Handle wide (multi-cell) glyphs" = "Behandle breite (multi-cell) Glyphen"; /* File: TerminalViewPrefs.m:515 */ "Start as login-shell" = "Als Login-Shell starten"; /* File: TerminalViewPrefs.m:527 */ /* Flag: untranslated */ "Shell:" = "Shell:"; /* File: TerminalViewPrefs.m:634 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Behandle die 'Command'-Taste als 'Meta'-Taste.\n\nWenn dies gew\u00e4hlt ist, dann k\u00f6nnen Men\u00fceintr\u00e4ge nicht mehr per\nTastatur bedient werden."; /* File: TerminalViewPrefs.m:651 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "F\u00fcr jedes 'Escape' ein doppeltes 'Escape' senden.\n\nDas bewirkt, dass 'Escape' von vielen Programmen schneller\nerkannt wird, aber nicht mehr als Ersatz f\u00fcr die\n'Meta'-Taste benutzt werden kann."; /* File: TerminalWindowPrefs.m:112 */ "Terminal Window" = "Terminal-Fenster"; /* File: TerminalWindowPrefs.m:117 */ "Terminal\nWindow" = "Terminal-\nFenster"; /* File: TerminalWindowPrefs.m:143 */ "Close new windows when idle" = "Neue unbenutzte Fenster schlie\u00dfen"; /* File: TerminalWindowPrefs.m:144 */ "Don't close new windows" = "Neue Fenster nicht schlie\u00dfen"; /* File: TerminalWindowPrefs.m:156 */ "Default size" = "Standardgr\u00f6\u00dfe"; /* File: TerminalWindowPrefs.m:160 */ "Width:" = "Breite:"; /* File: TerminalWindowPrefs.m:169 */ "Height:" = "H\u00f6he:"; /* File: TerminalWindowPrefs.m:192 */ "Add top and bottom border" = "F\u00fcge oberen und unteren Rand hinzu"; /* File: main.m:157 */ /* Flag: untranslated */ "Benchmark" = "Benchmark"; /* File: main.m:164 */ "New window" = "Neues Fenster"; /* File: main.m:167 */ /* Flag: unmatched */ "Terminal" = "Terminal"; /* File: main.m:171 */ "New terminal" = "Neues Fenster"; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:78 */ "Apply and save" = "\u00dcbernehmen und Speichern"; /* File: PreferencesWindowController.m:122 */ "Preferences" = "Einstellungen"; /* File: PreferencesWindowController.m:70 */ "Revert" = "Zur\u00fccksetzen"; /*** Strings from Services.m ***/ /* File: Services.m:152 */ "Service aborted by user." = "Dienst vom Benutzer unterbrochen."; /* File: Services.m:60 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "Es gibt keinen Terminal-Dienst namens '%@.\nDie Dienste sind vermutlich nicht auf neuestem Stand.\nStarte zum Aktualisieren 'make_services'"; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Abbrechen"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /* File: ServicesParameterWindowController.m:118 */ "Parameter for service %@" = "Parameter f\u00fcr Dienst %@"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:585 */ "Accept types" = "Akzeptierte Typen"; /* File: ServicesPrefs.m:499 */ "Add" = "Hinzuf\u00fcgen"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Fehler beim Importieren von Diensten"; /* File: ServicesPrefs.m:401 */ "Export services" = "Dienste exportieren"; /* File: ServicesPrefs.m:523 */ "Export..." = "Exportieren..."; /* File: ServicesPrefs.m:594 */ "Filenames" = "Dateinamen"; /* File: ServicesPrefs.m:549 */ "Ignore output" = "Ausgabe ignorieren"; /* File: ServicesPrefs.m:254 */ "Import services" = "Dienste importieren"; /* File: ServicesPrefs.m:515 */ "Import..." = "Importieren..."; /* File: ServicesPrefs.m:559 */ "Input in stdin" = "Eingabe in 'stdin'"; /* File: ServicesPrefs.m:560 */ "Input on command line" = "Eingabe in Befehlszeile"; /* File: ServicesPrefs.m:640 */ "Key:" = "Schl\u00fcssel:"; /* File: ServicesPrefs.m:627 */ "Name:" = "Name:"; /* File: ServicesPrefs.m:558 */ "No input" = "Keine Eingabe"; /* File: ServicesPrefs.m:602 */ "Plain text" = "Normaler Text"; /* File: ServicesPrefs.m:507 */ "Remove" = "Entfernen"; /* File: ServicesPrefs.m:550 */ "Return output" = "Ausgabe zur\u00fcckgeben"; /* File: ServicesPrefs.m:568 */ "Run in background" = "Im Hintergrund laufen"; /* File: ServicesPrefs.m:570 */ "Run in idle window" = "In unbenutztem Fenster starten"; /* File: ServicesPrefs.m:569 */ "Run in new window" = "In neuem Fenster starten"; /* File: ServicesPrefs.m:468 */ "Terminal services" = "Terminal-Dienste"; /* File: ServicesPrefs.m:473 */ "Terminal\nservices" = "Terminal-\nDienste"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "Die Datei '%@' enth\u00e4lt keine g\u00fcltigen Terminal-Dienste."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "Unbenannter Dienst"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1623 */ "Unable to fork: %m." = "Prozess kann nicht gestartet werden: %m."; /* File: TerminalView.m:1611 */ "Unable to open pipe for input: %m." = "Kann 'Pipe' nicht zur Eingabe benutzen: %m."; /* File: TerminalView.m:1476 */ "[Process exited]" = "[Prozess beendet]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:330 */ "Bold font:" = "Fettschrift:"; /* File: TerminalViewPrefs.m:298 */ "Color:" = "Farbe:"; /* File: TerminalViewPrefs.m:277 */ "Cursor" = "Cursor"; /* File: TerminalViewPrefs.m:230 */ /* File: TerminalViewPrefs.m:225 */ "Display" = "Darstellung"; /* File: TerminalViewPrefs.m:291 */ "Filled block" = "Gef\u00fcllter Block"; /* File: TerminalViewPrefs.m:292 */ "Inverted block" = "Invertierter Block"; /* File: TerminalViewPrefs.m:289 */ "Line" = "Linie"; /* File: TerminalViewPrefs.m:357 */ "Normal font:" = "Normalschrift:"; /* File: TerminalViewPrefs.m:369 */ /* File: TerminalViewPrefs.m:342 */ "Pick font..." = "Schriftauswahl..."; /* File: TerminalViewPrefs.m:290 */ "Stroked block" = "Hohler Block"; /* File: TerminalViewPrefs.m:282 */ "Style:" = "Stil:"; /*** Strings from TerminalWindow.m ***/ /* File: TerminalWindow.m:192 */ /* File: TerminalWindow.m:188 */ " (idle)" = " (unbenutzt)"; /*** Strings from main.m ***/ /* File: main.m:191 */ "Close" = "Schlie\u00dfen"; /* File: main.m:180 */ "Copy" = "Kopieren"; /* File: main.m:177 */ "Cut" = "Ausschneiden"; /* File: main.m:186 */ "Edit" = "Bearbeiten"; /* File: main.m:203 */ "Hide" = "Ausblenden"; /* File: main.m:159 */ "Info" = "Info"; /* File: main.m:153 */ "Info..." = "\u00dcber..."; /* File: main.m:183 */ "Paste" = "Einf\u00fcgen"; /* File: main.m:155 */ "Preferences..." = "Einstellungen..."; /* File: main.m:207 */ "Quit" = "Beenden"; /* File: main.m:199 */ "Services" = "Dienste"; /* File: main.m:194 */ "Windows" = "Fenster"; Terminal-0.9.8/ServicesParameterWindowController.m0000644000175000001440000000707511016341203021602 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #include #include #include #include #include #include #include #include #include "ServicesParameterWindowController.h" #include "autokeyviewchain.h" @implementation TerminalServicesParameterWindowController -(void) _cancel: (id)sender { [NSApp stopModalWithCode: NSRunAbortedResponse]; } -(void) _ok: (id)sender { [NSApp stopModalWithCode: NSRunStoppedResponse]; } - initWithCommandline: (NSString *)cmdline selectRange: (NSRange)r service: (NSString *)service_name { NSWindow *win; win=[[NSPanel alloc] initWithContentRect: NSMakeRect(100,100,380,100) styleMask: NSTitledWindowMask|NSResizableWindowMask backing: NSBackingStoreRetained defer: YES]; if (!(self=[super initWithWindow: win])) return nil; { GSVbox *vbox; vbox=[[GSVbox alloc] init]; [vbox setBorder: 4]; [vbox setDefaultMinYMargin: 4]; { NSButton *b; GSHbox *hbox; hbox=[[GSHbox alloc] init]; [hbox setDefaultMinXMargin: 4]; [hbox setAutoresizingMask: NSViewMinXMargin]; b=[[NSButton alloc] init]; [b setTitle: _(@"Cancel")]; [b setTarget: self]; [b setAction: @selector(_cancel:)]; [b sizeToFit]; [hbox addView: b]; [b release]; b=[[NSButton alloc] init]; [b setTitle: _(@"OK")]; [b setKeyEquivalent: @"\r"]; [b setTarget: self]; [b setAction: @selector(_ok:)]; [b sizeToFit]; [hbox addView: b]; [b release]; [vbox addView: hbox enablingYResizing: NO]; [hbox release]; } { NSTextField *f; tf_cmdline=f=[[NSTextField alloc] init]; [f setAutoresizingMask: NSViewWidthSizable]; [f sizeToFit]; [f setStringValue: cmdline]; [vbox addView: f enablingYResizing: NO]; DESTROY(f); f=[[NSTextField alloc] init]; [f setAutoresizingMask: NSViewMaxXMargin]; [f setStringValue: _(@"Command line:")]; [f setEditable: NO]; [f setDrawsBackground: NO]; [f setBordered: NO]; [f setBezeled: NO]; [f setSelectable: NO]; [f sizeToFit]; [f setAutoresizingMask: 0]; [vbox addView: f enablingYResizing: NO]; DESTROY(f); [tf_cmdline setTarget: self]; [tf_cmdline setAction: @selector(_ok:)]; } [win setContentView: vbox]; [vbox release]; } [win setDelegate: self]; [win setTitle: [NSString stringWithFormat: _(@"Parameter for service %@"), service_name]]; [win autoSetupKeyViewChain]; [win makeFirstResponder: tf_cmdline]; /* if (r.length) { NSText *t=[win fieldEditor: NO forObject: tf_cmdline]; printf("t=%@ r=%@\n",[t text],NSStringFromRange(r)); [t setSelectedRange: r]; }*/ [win release]; return self; } -(NSString *) _cmdline { return [[[tf_cmdline stringValue] retain] autorelease]; } +(NSString *) getCommandlineFrom: (NSString *)cmdline selectRange: (NSRange)r service: (NSString *)service_name { TerminalServicesParameterWindowController *wc; NSString *s; int result; wc=[[self alloc] initWithCommandline: cmdline selectRange: r service: service_name]; [wc showWindow: self]; result=[NSApp runModalForWindow: [wc window]]; s=[wc _cmdline]; [wc close]; DESTROY(wc); if (result==NSRunStoppedResponse) return s; else return nil; } @end Terminal-0.9.8/TerminalView.h0000644000175000001440000000472511236340515015333 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef TerminalView_h #define TerminalView_h #include extern NSString *TerminalViewBecameIdleNotification, *TerminalViewBecameNonIdleNotification, *TerminalViewTitleDidChangeNotification; #include "Terminal.h" /* TODO: this is slightly ugly */ @class TerminalParser_Linux; @class NSScroller; struct selection_range { int location,length; }; @interface TerminalView : NSView { NSScroller *scroller; NSFont *font,*boldFont; int font_encoding,boldFont_encoding; float fx,fy,fx0,fy0; BOOL use_multi_cell_glyphs; BOOL blackOnWhite; struct { int x0,y0,x1,y1; } dirty; int master_fd; unsigned char *write_buf; int write_buf_len,write_buf_size; int max_scrollback; int sb_length,current_scroll; screen_char_t *sbuf; int sx,sy; screen_char_t *screen; int cursor_x,cursor_y; int current_x,current_y; NSString *title_window,*title_miniwindow; NSObject *tp; int draw_all; /* 0=only lazy, 1=don't know, do all, 2=do all */ BOOL draw_cursor; struct selection_range selection; /* scrolling by compositing takes a long while, so we break out of such loops fairly often to process other events */ int num_scrolls; /* To avoid doing lots of scrolling compositing, we combine multiple full-screen scrolls. pending_scroll is the combined pending line delta */ int pending_scroll; BOOL ignore_resize; float border_x,border_y; } -(void) setIgnoreResize: (BOOL)ignore; -(void) setBorder: (float)x : (float)y; -(NSString *) windowTitle; -(NSString *) miniwindowTitle; +(NSSize) characterCellSize; +(void) registerPasteboardTypes; @end @interface TerminalView (display) -(void) setNeedsLazyDisplayInRect: (NSRect)r; @end /* TODO: this is ugly */ @interface TerminalView (scrolling_2) -(void) setScroller: (NSScroller *)sc; @end @interface TerminalView (input_2) -(void) closeProgram; -(void) runShell; -(void) runProgram: (NSString *)path withArguments: (NSArray *)args initialInput: (NSString *)d; -(void) runProgram: (NSString *)path withArguments: (NSArray *)args inDirectory: (NSString *)directory initialInput: (NSString *)d arg0: (NSString *)arg0; @end #endif Terminal-0.9.8/ServicesPrefs.m0000644000175000001440000003746211375066704015532 0ustar multixusers/* copyright 2002 Alexander Malmberg 2009-2010 GAP Project This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "Label.h" #import "ServicesPrefs.h" #import "Services.h" @implementation TerminalServicesPrefs -(void) _update { NSString *name,*new_name; NSMutableDictionary *d; int i; if (current<0) return; name=[service_list objectAtIndex: current]; new_name=[tf_name stringValue]; if (![new_name length]) new_name=name; d=[services objectForKey: name]; if (!d) d=[[NSMutableDictionary alloc] init]; [d setObject: [tf_key stringValue] forKey: Key]; [d setObject: [tf_cmdline stringValue] forKey: Commandline]; [d setObject: [NSString stringWithFormat: @"%i",[pb_input indexOfSelectedItem]] forKey: Input]; [d setObject: [NSString stringWithFormat: @"%i",[pb_output indexOfSelectedItem]] forKey: ReturnData]; [d setObject: [NSString stringWithFormat: @"%i",[pb_type indexOfSelectedItem]] forKey: Type]; i=0; if ([cb_string state]) i|=1; if ([cb_filenames state]) i|=2; [d setObject: [NSString stringWithFormat: @"%i",i] forKey: AcceptTypes]; if (![name isEqual: new_name]) { [services setObject: d forKey: new_name]; [services removeObjectForKey: name]; [service_list replaceObjectAtIndex: current withObject: new_name]; [list reloadData]; } } -(void) save { NSUserDefaults *ud; if (!services) return; if (!top) return; [self _update]; ud=[NSUserDefaults standardUserDefaults]; if (![services isEqual: [TerminalServices terminalServicesDictionary]]) { [ud setObject: [services copy] forKey: @"TerminalServices"]; [TerminalServices updateServicesPlist]; } } -(void) revert { NSDictionary *d; [list deselectAll: self]; DESTROY(services); DESTROY(service_list); services=[[NSMutableDictionary alloc] init]; d=[TerminalServices terminalServicesDictionary]; { NSEnumerator *e=[d keyEnumerator]; NSString *key; while ((key=[e nextObject])) { [services setObject: [[d objectForKey: key] mutableCopy] forKey: key]; } } service_list=[[[services allKeys] sortedArrayUsingSelector: @selector(compare:)] mutableCopy]; [list reloadData]; current=-1; [self tableViewSelectionDidChange: nil]; } -(int) numberOfRowsInTableView: (NSTableView *)tv { return [service_list count]; } -(id) tableView: (NSTableView *)tv objectValueForTableColumn: (NSTableColumn *)tc row: (int)row { return [service_list objectAtIndex: row]; } -(void) tableViewSelectionDidChange: (NSNotification *)n { int r=[list selectedRow]; if (current>=0) [self _update]; if (r>=0) { int i; NSString *name,*s; NSDictionary *d; name=[service_list objectAtIndex: r]; d=[services objectForKey: name]; [tf_name setEditable: YES]; [tf_cmdline setEditable: YES]; [tf_key setEditable: YES]; [pb_input setEnabled: YES]; [pb_output setEnabled: YES]; [pb_type setEnabled: YES]; [cb_string setEnabled: YES]; [cb_filenames setEnabled: YES]; [tf_name setStringValue: name]; s=[d objectForKey: Key]; [tf_key setStringValue: s?s:(NSString *)@""]; s=[d objectForKey: Commandline]; [tf_cmdline setStringValue: s?s:(NSString *)@""]; i=[[d objectForKey: Type] intValue]; if (i<0 || i>2) i=0; [pb_type selectItemAtIndex: i]; i=[[d objectForKey: Input] intValue]; if (i<0 || i>2) i=0; [pb_input selectItemAtIndex: i]; i=[[d objectForKey: ReturnData] intValue]; if (i<0 || i>1) i=0; [pb_output selectItemAtIndex: i]; if ([d objectForKey: AcceptTypes]) { i=[[d objectForKey: AcceptTypes] intValue]; [cb_string setState: !!(i&1)]; [cb_filenames setState: !!(i&2)]; } else { [cb_string setState: 1]; [cb_filenames setState: 0]; } } else { [tf_name setEditable: NO]; [tf_cmdline setEditable: NO]; [tf_key setEditable: NO]; [pb_input setEnabled: NO]; [pb_output setEnabled: NO]; [pb_type setEnabled: NO]; [cb_string setEnabled: NO]; [cb_filenames setEnabled: NO]; [tf_name setStringValue: @""]; [tf_key setStringValue: @""]; [tf_cmdline setStringValue: @""]; } current=r; } -(void) _removeService: (id)sender { NSString *name; if (current<0) return; [list deselectAll: self]; name=[service_list objectAtIndex: current]; [services removeObjectForKey: name]; [service_list removeObjectAtIndex: current]; [list reloadData]; current=-1; [self tableViewSelectionDidChange: nil]; } -(void) _addService: (id)sender { NSString *n=_(@"Unnamed service"); [service_list addObject: n]; [list reloadData]; [list selectRow: [service_list count]-1 byExtendingSelection: NO]; } -(void) _importServices: (id)sender { NSOpenPanel *op; NSDictionary *d; NSEnumerator *e; NSString *name; int result; [self save]; op=[NSOpenPanel openPanel]; [op setAccessoryView: nil]; [op setTitle: _(@"Import services")]; [op setAllowsMultipleSelection: NO]; [op setCanChooseDirectories: NO]; [op setCanChooseFiles: YES]; result=[op runModal]; if (result!=NSOKButton) return; d=[NSDictionary dictionaryWithContentsOfFile: [op filename]]; d=[d objectForKey: @"TerminalServices"]; if (!d) { NSString *s=[NSString stringWithContentsOfFile: [op filename]]; NSArray *lines=[s componentsSeparatedByString: @"\n"]; NSArray *parts; int c=[lines count]; int i,j,k; NSMutableDictionary *md=[[[NSMutableDictionary alloc] init] autorelease]; NSMutableDictionary *service; for (i=0;i=c) break; parts=[[lines objectAtIndex: i] componentsSeparatedByString: @" "]; if ([parts count]!=11) break; service=[[NSMutableDictionary alloc] init]; [service setObject: [lines objectAtIndex: i+2] forKey: Commandline]; j=[[parts objectAtIndex: 0] intValue]; if (j!=32) { unichar ch=j; [service setObject: [NSString stringWithCharacters: &ch length: 1] forKey: Key]; } j=[[parts objectAtIndex: 2] intValue]; k=0; if (j&3) /* TODO? why 1 and 2? */ k|=ACCEPT_STRING; if (j&8) k|=ACCEPT_FILENAMES; [service setObject: [NSString stringWithFormat: @"%i",k] forKey: AcceptTypes]; if (j==1) { k=0; } else { j=[[parts objectAtIndex: 3] intValue]; if (j==2) k=INPUT_CMDLINE; else if (j==4) k=INPUT_STDIN; else k=INPUT_NO; } [service setObject: [NSString stringWithFormat: @"%i",k] forKey: Input]; j=[[parts objectAtIndex: 8] intValue]; if (j==3) k=1; else k=0; [service setObject: [NSString stringWithFormat: @"%i",k] forKey: ReturnData]; j=[[parts objectAtIndex: 5] intValue]; if (j==2) k=TYPE_WINDOW_IDLE; else if (j==4) k=TYPE_WINDOW_NEW; else k=TYPE_BACKGROUND; [service setObject: [NSString stringWithFormat: @"%i",k] forKey: Type]; [md setObject: service forKey: [lines objectAtIndex: i+1]]; } if (i /\""; Input = 1; Key = ""; ReturnData = 1; Type = 0; }; "Wrap to 72 Columns" = { Commandline = "fmt -w 72"; Input = 1; Key = ""; ReturnData = 1; Type = 0; }; bunzip2 = { AcceptTypes = 2; Commandline = "bunzip2 %s"; Input = 2; Key = ""; ReturnData = 0; Type = 0; }; bzip2 = { AcceptTypes = 2; Commandline = "bzip2 %s"; Input = 2; Key = ""; ReturnData = 0; Type = 0; }; gunzip = { AcceptTypes = 2; Commandline = "gunzip %s"; Input = 2; Key = ""; ReturnData = 0; Type = 0; }; gzip = { AcceptTypes = 2; Commandline = "gzip %s"; Input = 2; Key = ""; ReturnData = 0; Type = 0; }; }; }Terminal-0.9.8/TerminalViewPrefs.h0000644000175000001440000000332611736632073016337 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg 2009-2011 GNUstep Application Project (Riccardo Mottola) This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef TerminalViewPrefs_h #define TerminalViewPrefs_h #include "PrefBox.h" @class NSString,NSFont,NSColor; @class GSVbox,NSTextField,NSColorWell,NSMatrix; extern NSString *TerminalViewDisplayPrefsDidChangeNotification; @interface TerminalViewDisplayPrefs : NSObject { GSVbox *top; NSTextField *f_terminalFont,*f_boldTerminalFont; NSColorWell *w_cursorColor; NSMatrix *m_cursorStyle; NSTextField *f_scrollBackLines; NSButton *b_useMultiCellGlyphs; NSButton *b_blackOnWhite; NSTextField *f_cur; } +(NSFont *) terminalFont; +(NSFont *) boldTerminalFont; +(BOOL) useMultiCellGlyphs; +(BOOL) blackOnWhite; +(const float *) brightnessForIntensities; +(const float *) saturationForIntensities; #define CURSOR_LINE 0 #define CURSOR_BLOCK_STROKE 1 #define CURSOR_BLOCK_FILL 2 #define CURSOR_BLOCK_INVERT 3 +(int) cursorStyle; +(NSColor *) cursorColor; +(int) scrollBackLines; @end @interface TerminalViewShellPrefs : NSObject { GSVbox *top; NSTextField *tf_shell; NSButton *b_loginShell; } +(NSString *) shell; +(BOOL) loginShell; @end @interface TerminalViewKeyboardPrefs : NSObject { GSVbox *top; NSButton *b_commandAsMeta; NSButton *b_doubleEscape; NSButton *b_altIsNotMeta; } +(BOOL) commandAsMeta; +(BOOL) altIsNotMeta; +(BOOL) doubleEscape; @end #endif Terminal-0.9.8/Swedish.lproj/0000755000175000001440000000000011667362252015311 5ustar multixusersTerminal-0.9.8/Swedish.lproj/Localizable.strings0000644000175000001440000001774011016341203021133 0ustar multixusers/*** Swedish.lproj/Localizable.strings updated by make_strings 2002-12-09 18:39:09 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:653 */ "Command line:" = "Kommandorad:"; /*** Unmatched/untranslated keys ***/ /* File: TerminalView.m:1611 */ /* Flag: untranslated */ "Unable to open pipe for input: %m." = "Unable to open pipe for input: %m."; /* File: TerminalViewPrefs.m:319 */ /* Flag: untranslated */ "Handle wide (multi-cell) glyphs" = "Hantera breda (fler-celliga) tecken."; /* File: main.m:167 */ /* Flag: unmatched */ "Terminal" = "Terminal"; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:78 */ "Apply and save" = "Verkst\u00e4ll och spara"; /* File: PreferencesWindowController.m:122 */ "Preferences" = "Inst\u00e4llningar"; /* File: PreferencesWindowController.m:70 */ "Revert" = "\u00c5terst\u00e4ll"; /*** Strings from Services.m ***/ /* File: Services.m:152 */ "Service aborted by user." = "Tj\u00e4nsten avbr\u00f6ts av anv\u00e4ndaren."; /* File: Services.m:60 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "Det finns ingen terminaltj\u00e4nst '%@'.\nDin tj\u00e4nstlista \u00e4r troligen gammal.\nK\u00f6r 'make_services' f\u00f6r att uppdatera den."; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Avbryt"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /* File: ServicesParameterWindowController.m:118 */ "Parameter for service %@" = "Parameter f\u00e4r tj\u00e4nst %@"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:585 */ "Accept types" = "Acceptera typer"; /* File: ServicesPrefs.m:499 */ "Add" = "L\u00e4gg till"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Fel vid importering av tj\u00e4nster"; /* File: ServicesPrefs.m:401 */ "Export services" = "Exportera tj\u00e4nster"; /* File: ServicesPrefs.m:523 */ "Export..." = "Exportera..."; /* File: ServicesPrefs.m:594 */ "Filenames" = "Filnamn"; /* File: ServicesPrefs.m:549 */ "Ignore output" = "Ignorera utdata"; /* File: ServicesPrefs.m:254 */ "Import services" = "Importera tj\u00e4nster"; /* File: ServicesPrefs.m:515 */ "Import..." = "Importera..."; /* File: ServicesPrefs.m:559 */ "Input in stdin" = "Indata till stdin"; /* File: ServicesPrefs.m:560 */ "Input on command line" = "Indata p\u00e5 kommandoraden"; /* File: ServicesPrefs.m:640 */ "Key:" = "Tangent:"; /* File: ServicesPrefs.m:627 */ "Name:" = "Namn:"; /* File: ServicesPrefs.m:558 */ "No input" = "Ingen indata"; /* File: ServicesPrefs.m:602 */ "Plain text" = "Vanlig text"; /* File: ServicesPrefs.m:507 */ "Remove" = "Ta bort"; /* File: ServicesPrefs.m:550 */ "Return output" = "Returnera utdata"; /* File: ServicesPrefs.m:568 */ "Run in background" = "K\u00f6r i bakgrunden"; /* File: ServicesPrefs.m:570 */ "Run in idle window" = "K\u00f6r i ledigt f\u00f6nster"; /* File: ServicesPrefs.m:569 */ "Run in new window" = "K\u00f6r i nytt f\u00f6nster"; /* File: ServicesPrefs.m:468 */ "Terminal services" = "Terminaltj\u00e4nster"; /* File: ServicesPrefs.m:473 */ "Terminal\nservices" = "Terminal-\ntj\u00e4nster"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "Filen '%@' inneh\u00e5ller inte giltiga terminaltj\u00e4nster."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "Icke namngiven tj\u00e4nst"; /*** Strings from TerminalParser_LinuxPrefs.m ***/ /* File: TerminalParser_LinuxPrefs.m:103 */ "'linux' terminal parser" = "'linux' terminal-emulator"; /* File: TerminalParser_LinuxPrefs.m:108 */ "'linux'\nparser" = "'linux'\nemulator"; /* File: TerminalParser_LinuxPrefs.m:151 */ "Character set:" = "Teckenupps\u00e4ttning:"; /* File: TerminalParser_LinuxPrefs.m:43 */ "Chinese" = "Kinesiska"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Custom, leave unchanged" = "Egen, l\u00e4mna of\u00f6r\u00e4ndrad"; /* File: TerminalParser_LinuxPrefs.m:42 */ "East Europe, latin2" = "\u00d6stra europa, latin2"; /* File: TerminalParser_LinuxPrefs.m:40 */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:41 */ "West Europe, latin1" = "V\u00e4stra europa, latin1"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1623 */ "Unable to fork: %m." = "Kunde inte starta ny process: %m."; /* File: TerminalView.m:1476 */ "[Process exited]" = "[Processen avslutade]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:330 */ "Bold font:" = "Fett typsnitt:"; /* File: TerminalViewPrefs.m:298 */ "Color:" = "F\u00e4rg:"; /* File: TerminalViewPrefs.m:277 */ "Cursor" = "Mark\u00f6r"; /* File: TerminalViewPrefs.m:230 */ /* File: TerminalViewPrefs.m:225 */ "Display" = "Uppritning"; /* File: TerminalViewPrefs.m:291 */ "Filled block" = "Fyllt block"; /* File: TerminalViewPrefs.m:292 */ "Inverted block" = "Inverterat block"; /* File: TerminalViewPrefs.m:607 */ /* File: TerminalViewPrefs.m:602 */ "Keyboard" = "Tangentbord"; /* File: TerminalViewPrefs.m:289 */ "Line" = "Streck"; /* File: TerminalViewPrefs.m:357 */ "Normal font:" = "Normalt typsnitt:"; /* File: TerminalViewPrefs.m:369 */ /* File: TerminalViewPrefs.m:342 */ "Pick font..." = "V\u00e4lj typsnitt..."; /* File: TerminalViewPrefs.m:255 */ "Scroll-back length in lines:" = "Scroll-back l\u00e4ngd i rader:"; /* File: TerminalViewPrefs.m:651 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "Skicka dubbel-escape f\u00f6r escape-tangenten.\n\nDetta inneb\u00e4r att escape tangenten\nkommer att k\u00e4nnas igen snabbare av m\u00e4nga\nprogram, men du kommer inte kunda anv\u00e4nda\nden som ers\u00e4ttning f\u00f6r meta."; /* File: TerminalViewPrefs.m:492 */ /* File: TerminalViewPrefs.m:487 */ "Shell" = "Skal"; /* File: TerminalViewPrefs.m:527 */ "Shell:" = "Skal:"; /* File: TerminalViewPrefs.m:515 */ "Start as login-shell" = "Starta som login-skal"; /* File: TerminalViewPrefs.m:290 */ "Stroked block" = "Ih\u00e5ligt block"; /* File: TerminalViewPrefs.m:282 */ "Style:" = "Stil:"; /* File: TerminalViewPrefs.m:634 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Behandla kommand-tangenten som meta.\n\nObservera att med denna inst\u00e4llningen\nkommer du inte kunna komma \u00e4t menyn\nmed tangentbordet."; /*** Strings from TerminalWindow.m ***/ /* File: TerminalWindow.m:192 */ /* File: TerminalWindow.m:188 */ " (idle)" = " (ledig)"; /*** Strings from TerminalWindowPrefs.m ***/ /* File: TerminalWindowPrefs.m:192 */ "Add top and bottom border" = "L\u00e4gg till undre och \u00f6vre kant"; /* File: TerminalWindowPrefs.m:143 */ "Close new windows when idle" = "St\u00e4ng inaktiva nya f\u00f6nster"; /* File: TerminalWindowPrefs.m:156 */ "Default size" = "Standardstorlek"; /* File: TerminalWindowPrefs.m:144 */ "Don't close new windows" = "St\u00e4ng inte nya f\u00f6nster"; /* File: TerminalWindowPrefs.m:169 */ "Height:" = "H\u00f6jd:"; /* File: TerminalWindowPrefs.m:112 */ "Terminal Window" = "Terminal F\u00f6nster"; /* File: TerminalWindowPrefs.m:117 */ "Terminal\nWindow" = "Terminal\nF\u00f6nster"; /* File: TerminalWindowPrefs.m:160 */ "Width:" = "Bredd:"; /*** Strings from main.m ***/ /* File: main.m:157 */ "Benchmark" = "Benchmark"; /* File: main.m:191 */ "Close" = "St\u00e4ng"; /* File: main.m:180 */ "Copy" = "Kopiera"; /* File: main.m:177 */ "Cut" = "Klipp"; /* File: main.m:186 */ "Edit" = "Redigera"; /* File: main.m:203 */ "Hide" = "G\u00f6m"; /* File: main.m:159 */ "Info" = "Info"; /* File: main.m:153 */ "Info..." = "Info..."; /* File: main.m:171 */ "New terminal" = "Ny terminal"; /* File: main.m:183 */ "Paste" = "Klistra"; /* File: main.m:155 */ "Preferences..." = "Inst\u00e4llningar..."; /* File: main.m:207 */ "Quit" = "Avsluta"; /* File: main.m:199 */ "Services" = "Tj\u00e4nster"; /* File: main.m:194 */ "Windows" = "F\u00f6nster"; Terminal-0.9.8/Services.m0000644000175000001440000002252211375060264014514 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #include #include #include #include #include #include #include #include #include #include #include "Services.h" #include "ServicesParameterWindowController.h" #include "TerminalWindow.h" #include "TerminalView.h" @implementation TerminalServices -(NSDictionary *) _serviceInfoForName: (NSString *)name { NSDictionary *d; d=[TerminalServices terminalServicesDictionary]; d=[d objectForKey: name]; if (!d || ![d isKindOfClass: [NSDictionary class]]) return nil; return d; } -(void) terminalService: (NSPasteboard *)pb userData: (NSString *)name error: (NSString **)error { NSDictionary *info=[self _serviceInfoForName: name]; int type,input,ret_data,accepttypes; NSString *cmdline; NSString *data; NSDebugLLog(@"service",@"run service %@\n",name); if (!info) { NSString *s= _(@"There is no terminal service called '%@'.\n" @"Your services list is probably out-of-date.\n" @"Run 'make_services' to update it."); *error=[[NSString stringWithFormat: s, name] retain]; return; } type=[[info objectForKey: Type] intValue]; ret_data=[[info objectForKey: ReturnData] intValue]; input=[[info objectForKey: Input] intValue]; cmdline=[info objectForKey: Commandline]; if ([info objectForKey: AcceptTypes]) accepttypes=[[info objectForKey: AcceptTypes] intValue]; else accepttypes=ACCEPT_STRING; NSDebugLLog(@"service",@"cmdline='%@' %i %i %i %i", cmdline,type,ret_data,input,accepttypes); data=nil; if (input && accepttypes&ACCEPT_STRING && (data=[pb stringForType: NSStringPboardType])) { } else if (input && accepttypes&ACCEPT_FILENAMES && (data=[pb propertyListForType: NSFilenamesPboardType])) { NSDebugLLog(@"service",@"got filenames '%@' '%@' %i",data,[data class],[data isProxy]); } NSDebugLLog(@"service",@"got data '%@'",data); NSLog(@"got data '%@'",data); if (input==INPUT_STDIN) { if ([data isKindOfClass: [NSArray class]]) data=[(NSArray *)data componentsJoinedByString: @"\n"]; } else if (input==INPUT_CMDLINE) { if (data && [data isKindOfClass: [NSArray class]]) data=[(NSArray *)data componentsJoinedByString: @" "]; } { int i; BOOL add_args; NSMutableString *str=[cmdline mutableCopy]; unichar ch; int p_pos; add_args=YES; p_pos=-1; for (i=0;i<[str length]-1;i++) { ch=[str characterAtIndex: i]; if (ch!='%') continue; ch=[str characterAtIndex: i+1]; if (ch=='%') { [str replaceCharactersInRange: NSMakeRange(i,1) withString: @""]; continue; } if (ch=='s' && data && input==2) { add_args=NO; [str replaceCharactersInRange: NSMakeRange(i,2) withString: data]; i+=[data length]; continue; } if (ch=='p') { p_pos=i; continue; } } if (input==INPUT_CMDLINE && data && add_args) { [str appendString: @" "]; [str appendString: data]; } cmdline=[str autorelease]; if (p_pos!=-1) { cmdline=[TerminalServicesParameterWindowController getCommandlineFrom: cmdline selectRange: NSMakeRange(p_pos,2) service: name]; if (!cmdline) { *error=[_(@"Service aborted by user.") retain]; return; } } } NSDebugLLog(@"service",@"final command line='%@'",cmdline); NSLog(@"final command line='%@'",cmdline); switch (type) { case TYPE_BACKGROUND: { NSTask *t=[[[NSTask alloc] init] autorelease]; NSPipe *sin,*sout; NSFileHandle *in,*out; [t setLaunchPath: @"/bin/sh"]; [t setArguments: [NSArray arrayWithObjects: @"-c",cmdline,nil]]; NSDebugLLog(@"service",@"t=%@",t); sin=[[[NSPipe alloc] init] autorelease]; [t setStandardInput: sin]; in=[sin fileHandleForWriting]; sout=[[[NSPipe alloc] init] autorelease]; [t setStandardOutput: sout]; out=[sout fileHandleForReading]; NSDebugLLog(@"service",@"launching"); [t launch]; if (data && input==INPUT_STDIN) { NSDebugLLog(@"service",@"writing data"); [in writeData: [data dataUsingEncoding: NSUTF8StringEncoding]]; } [in closeFile]; /* NSDebugLLog(@"service",@"waitUntilExit"); [t waitUntilExit];*/ if (ret_data) { NSString *s; NSData *result; NSDebugLLog(@"service",@"get result"); result=[out readDataToEndOfFile]; NSDebugLLog(@"service",@"got data |%@|",result); s=[[NSString alloc] initWithData: result encoding: NSUTF8StringEncoding]; s=[s autorelease]; NSDebugLLog(@"service",@"= '%@'",s); if (accepttypes==(ACCEPT_STRING|ACCEPT_FILENAMES)) [pb declareTypes: [NSArray arrayWithObjects: NSStringPboardType,NSFilenamesPboardType,nil] owner: self]; else if (accepttypes==ACCEPT_FILENAMES) [pb declareTypes: [NSArray arrayWithObjects: NSFilenamesPboardType,nil] owner: self]; else if (accepttypes==ACCEPT_STRING) [pb declareTypes: [NSArray arrayWithObjects: NSStringPboardType,nil] owner: self]; if (accepttypes&ACCEPT_FILENAMES) { NSMutableArray *ma=[[[NSMutableArray alloc] init] autorelease]; int i,c=[s length]; NSRange cur; for (i=0;i32;i++) ; cur.length=i-cur.location; [ma addObject: [s substringWithRange: cur]]; } NSDebugLLog(@"service",@"returning filenames: %@",ma); [pb setPropertyList: ma forType: NSFilenamesPboardType]; } if (accepttypes&ACCEPT_STRING) [pb setString: s forType: NSStringPboardType]; NSDebugLLog(@"service",@"return is set"); } else { NSDebugLLog(@"service",@"ignoring output"); [out closeFile]; [t waitUntilExit]; } NSDebugLLog(@"service",@"clean up"); } break; case TYPE_WINDOW_IDLE: case TYPE_WINDOW_NEW: { TerminalWindowController *twc=nil; if (type==TYPE_WINDOW_IDLE) twc=[TerminalWindowController idleTerminalWindow]; if (!twc) twc=[TerminalWindowController newTerminalWindow]; NSDebugLLog(@"service",@"got window %@",twc); [[twc terminalView] runProgram: @"/bin/sh" withArguments: [NSArray arrayWithObjects: @"-c",cmdline,nil] initialInput: input==INPUT_STDIN?data:0]; } break; } NSDebugLLog(@"service",@"return"); } +(void) updateServicesPlist { NSMutableArray *a; NSDictionary *d; NSEnumerator *e; NSString *name; d=[TerminalServices terminalServicesDictionary]; a=[[NSMutableArray alloc] init]; e=[d keyEnumerator]; while ((name=[e nextObject])) { int i; NSString *key; NSMutableDictionary *md; NSDictionary *info; NSArray *types; NSString *menu_name; info=[d objectForKey: name]; md=[[NSMutableDictionary alloc] init]; [md setObject: @"Terminal" forKey: @"NSPortName"]; [md setObject: @"terminalService" forKey: @"NSMessage"]; [md setObject: name forKey: @"NSUserData"]; if ([name characterAtIndex: 0]=='/') menu_name=[name substringFromIndex: 1]; else menu_name=[NSString stringWithFormat: @"%@/%@",@"Terminal",name]; [md setObject: [NSDictionary dictionaryWithObjectsAndKeys: menu_name, @"default",nil] forKey: @"NSMenuItem"]; key=[info objectForKey: Key]; if (key && [key length]) { [md setObject: [NSDictionary dictionaryWithObjectsAndKeys: key,@"default",nil] forKey: @"NSKeyEquivalent"]; } if ([info objectForKey: AcceptTypes]) i=[[info objectForKey: AcceptTypes] intValue]; else i=ACCEPT_STRING; if (i==(ACCEPT_STRING|ACCEPT_FILENAMES)) types=[NSArray arrayWithObjects: NSStringPboardType,NSFilenamesPboardType,nil]; else if (i==ACCEPT_FILENAMES) types=[NSArray arrayWithObjects: NSFilenamesPboardType,nil]; else if (i==ACCEPT_STRING) types=[NSArray arrayWithObjects: NSStringPboardType,nil]; else types=nil; i=[[info objectForKey: Input] intValue]; if (types && (i==INPUT_STDIN || i==INPUT_CMDLINE)) [md setObject: types forKey: @"NSSendTypes"]; i=[[info objectForKey: Type] intValue]; if (i==TYPE_BACKGROUND) { i=[[info objectForKey: ReturnData] intValue]; if (types && i==1) [md setObject: types forKey: @"NSReturnTypes"]; } [a addObject: md]; DESTROY(md); } { NSString *path; path=[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,NSUserDomainMask,YES) lastObject]; path=[path stringByAppendingPathComponent: @"Services"]; path=[path stringByAppendingPathComponent: @"TerminalServices.plist"]; d=[NSDictionary dictionaryWithObject: a forKey: @"NSServices"]; [d writeToFile: path atomically: YES]; } /* TODO: if a submenu of services is 'held' open when services are reloaded, -gui crashes */ [[NSWorkspace sharedWorkspace] findApplications]; } +(NSDictionary *) terminalServicesDictionary { NSDictionary *d; d=[[NSUserDefaults standardUserDefaults] dictionaryForKey: @"TerminalServices"]; if (d) return d; d=[NSDictionary dictionaryWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @"DefaultTerminalServices" ofType: @"svcs"]]; d=[d objectForKey: @"TerminalServices"]; return d; } @end Terminal-0.9.8/cursor_filled.tiff0000644000175000001440000000262411561216225016257 0ustar multixusersMM*Ð Ð þÌÈ( Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø ÀøÈÌÈÈÌÈÈÌÈÈÌÈ Àø Àø Àø Àø Àø Àø ÀøÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ Àø Àø Àø Àø Àø Àø ÀøÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ Àø Àø Àø Àø Àø Àø ÀøÈÌÈÈÌÈÈÌÈ Àø Àø Àø Àø Àø Àø ÀøÈÌÈÈÌÈÈÌÈÈÌÈ Àø Àø Àø Àø Àø Àø ÀøÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ Àø Àø Àø Àø Àø Àø ÀøÈÌÈÈÌÈÈÌÈÈÌÈ Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø ÀøTerminal-0.9.8/cursor_inverted.tiff0000644000175000001440000000262411561216225016640 0ustar multixusersMM*Ð Ð þÌÈ(øüøøüøøüøøüøøüøøüøøüøøüøøüøøüøøüøøüøøüøøüø000øüøøüøøüøøüøøüøøüø000øüøøüøøüøøüøøüøøüø000øüøøüøøüøøüøøüøøüøÈÌÈÈÌÈÈÌÈÈÌÈ000øüø000000000øüøøüøÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ000000øüøøüøøüø000øüøÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ000øüøøüøøüøøüø000øüøÈÌÈÈÌÈÈÌÈ000øüøøüøøüøøüø000øüøÈÌÈÈÌÈÈÌÈÈÌÈ000000øüøøüøøüø000øüøÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ000øüø000000000øüøøüøÈÌÈÈÌÈÈÌÈÈÌÈøüøøüøøüøøüøøüøøüøøüøøüøøüøøüøøüøøüøøüøøüøTerminal-0.9.8/TerminalViewPrefs.m0000644000175000001440000004164511736632073016352 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg 2009-2011 GAP Project This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "Label.h" #import "TerminalViewPrefs.h" NSString *TerminalViewDisplayPrefsDidChangeNotification= @"TerminalViewDisplayPrefsDidChangeNotification"; static NSUserDefaults *ud; static NSString *TerminalFontKey=@"TerminalFont", *TerminalFontSizeKey=@"TerminalFontSize", *BoldTerminalFontKey=@"BoldTerminalFont", *BoldTerminalFontSizeKey=@"BoldTerminalFontSize", *UseMultiCellGlyphsKey=@"UseMultiCellGlyphs", *BlackOnWhiteKey=@"BlackOnWhite", *CursorStyleKey=@"CursorStyle", *ScrollBackLinesKey=@"ScrollBackLines", *CursorColorRKey=@"CursorColorR", *CursorColorGKey=@"CursorColorG", *CursorColorBKey=@"CursorColorB", *CursorColorAKey=@"CursorColorA"; static NSFont *terminalFont,*boldTerminalFont; static BOOL useMultiCellGlyphs; static BOOL blackOnWhite; static float brightness[3]={0.6,0.8,1.0}; static float saturation[3]={1.0,1.0,0.75}; static int cursorStyle; static NSColor *cursorColor; static int scrollBackLines; @implementation TerminalViewDisplayPrefs +(void) initialize { if (!ud) ud=[NSUserDefaults standardUserDefaults]; if (!cursorColor) { NSString *s; float size; size=[ud floatForKey: TerminalFontSizeKey]; s=[ud stringForKey: TerminalFontKey]; if (!s) terminalFont=[[NSFont userFixedPitchFontOfSize: size] retain]; else { terminalFont=[[NSFont fontWithName: s size: size] retain]; if (!terminalFont) terminalFont=[[NSFont userFixedPitchFontOfSize: size] retain]; } size=[ud floatForKey: BoldTerminalFontSizeKey]; s=[ud stringForKey: BoldTerminalFontKey]; if (!s) boldTerminalFont=[[NSFont userFixedPitchFontOfSize: size] retain]; else { boldTerminalFont=[[NSFont fontWithName: s size: size] retain]; if (!boldTerminalFont) boldTerminalFont=[[NSFont userFixedPitchFontOfSize: size] retain]; } useMultiCellGlyphs=[ud boolForKey: UseMultiCellGlyphsKey]; blackOnWhite=[ud boolForKey: BlackOnWhiteKey]; cursorStyle=[ud integerForKey: CursorStyleKey]; if ([ud objectForKey: CursorColorRKey]) { float r,g,b,a; r=[ud floatForKey: CursorColorRKey]; g=[ud floatForKey: CursorColorGKey]; b=[ud floatForKey: CursorColorBKey]; a=[ud floatForKey: CursorColorAKey]; cursorColor=[[NSColor colorWithCalibratedRed: r green: g blue: b alpha: a] retain]; } else { cursorColor=[[NSColor whiteColor] retain]; } scrollBackLines=[ud integerForKey: ScrollBackLinesKey]; if (scrollBackLines<=0) scrollBackLines=256; } } +(NSFont *) terminalFont { NSFont *f=[terminalFont screenFont]; if (f) return f; return terminalFont; } +(NSFont *) boldTerminalFont { NSFont *f=[boldTerminalFont screenFont]; if (f) return f; return boldTerminalFont; } +(BOOL) useMultiCellGlyphs { return useMultiCellGlyphs; } +(BOOL) blackOnWhite { return blackOnWhite; } +(const float *) brightnessForIntensities { return brightness; } +(const float *) saturationForIntensities { return saturation; } +(int) cursorStyle { return cursorStyle; } +(NSColor *) cursorColor { return cursorColor; } +(int) scrollBackLines { return scrollBackLines; } -(void) save { BOOL newState; if (!top) return; newState = !![b_blackOnWhite state]; if (blackOnWhite != newState) { blackOnWhite = newState; [ud setBool: blackOnWhite forKey: BlackOnWhiteKey]; if (blackOnWhite == YES) { [w_cursorColor setColor: [NSColor blackColor]]; } else { [w_cursorColor setColor: [NSColor whiteColor]]; } [w_cursorColor setNeedsDisplay]; } cursorStyle=[[m_cursorStyle selectedCell] tag]; [ud setInteger: cursorStyle forKey: CursorStyleKey]; { DESTROY(cursorColor); cursorColor=[w_cursorColor color]; cursorColor=[[cursorColor colorUsingColorSpaceName: NSCalibratedRGBColorSpace] retain]; [ud setFloat: [cursorColor redComponent] forKey: CursorColorRKey]; [ud setFloat: [cursorColor greenComponent] forKey: CursorColorGKey]; [ud setFloat: [cursorColor blueComponent] forKey: CursorColorBKey]; [ud setFloat: [cursorColor alphaComponent] forKey: CursorColorAKey]; } ASSIGN(terminalFont,[f_terminalFont font]); [ud setFloat: [terminalFont pointSize] forKey: TerminalFontSizeKey]; [ud setObject: [terminalFont fontName] forKey: TerminalFontKey]; ASSIGN(boldTerminalFont,[f_boldTerminalFont font]); [ud setFloat: [boldTerminalFont pointSize] forKey: BoldTerminalFontSizeKey]; [ud setObject: [boldTerminalFont fontName] forKey: BoldTerminalFontKey]; scrollBackLines=[f_scrollBackLines intValue]; [ud setInteger: scrollBackLines forKey: ScrollBackLinesKey]; useMultiCellGlyphs=!![b_useMultiCellGlyphs state]; [ud setBool: useMultiCellGlyphs forKey: UseMultiCellGlyphsKey]; [[NSNotificationCenter defaultCenter] postNotificationName: TerminalViewDisplayPrefsDidChangeNotification object: self]; } -(void) revert { NSFont *f; [b_useMultiCellGlyphs setState: useMultiCellGlyphs]; [b_blackOnWhite setState: blackOnWhite]; [m_cursorStyle selectCellWithTag: [[self class] cursorStyle]]; [w_cursorColor setColor: [[self class] cursorColor]]; f=[isa terminalFont]; [f_terminalFont setStringValue: [NSString stringWithFormat: @"%@ %0.1f",[f fontName],[f pointSize]]]; [f_terminalFont setFont: f]; f=[isa boldTerminalFont]; [f_boldTerminalFont setStringValue: [NSString stringWithFormat: @"%@ %0.1f",[f fontName],[f pointSize]]]; [f_boldTerminalFont setFont: f]; [f_scrollBackLines setIntValue: scrollBackLines]; } -(NSString *) name { return _(@"Display"); } -(void) setupButton: (NSButton *)b { [b setTitle: _(@"Display")]; [b sizeToFit]; } -(void) willHide { } -(NSView *) willShow { if (!top) { top=[[GSVbox alloc] init]; [top setDefaultMinYMargin: 2]; [top addView: [[[NSView alloc] init] autorelease] enablingYResizing: YES]; { NSTextField *f; NSButton *butt; GSHbox *hb; hb=[[GSHbox alloc] init]; [hb setDefaultMinXMargin: 4]; [hb setAutoresizingMask: NSViewWidthSizable]; f=[NSTextField newLabel: _(@"Scroll-back length in lines:")]; [f setAutoresizingMask: 0]; [hb addView: f enablingXResizing: NO]; DESTROY(f); f_scrollBackLines=f=[[NSTextField alloc] init]; [f setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; [f sizeToFit]; [hb addView: f enablingXResizing: YES]; DESTROY(f); [top addView: hb enablingYResizing: NO]; DESTROY(hb); [top addView: [[[NSView alloc] init] autorelease] enablingYResizing: YES]; { NSBox *box; GSTable *t; NSColorWell *w; box=[[NSBox alloc] init]; [box setAutoresizingMask: NSViewMinXMargin|NSViewMaxXMargin]; [box setTitle: _(@"Cursor")]; t = [[[GSTable alloc] initWithNumberOfRows: 2 numberOfColumns: 2] autorelease]; [t setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; f=[NSTextField newLabel: _(@"Style:")]; [f setAutoresizingMask: NSViewMinXMargin|NSViewMinYMargin|NSViewMaxYMargin]; [t putView: f atRow: 0 column: 0 withXMargins: 2 yMargins: 2]; DESTROY(f); { NSMatrix *m; NSButtonCell *bc=[NSButtonCell new]; NSSize s; [bc setImagePosition: NSImageOnly]; [bc setHighlightsBy: NSChangeBackgroundCellMask]; [bc setShowsStateBy: NSChangeBackgroundCellMask]; m=m_cursorStyle=[[NSMatrix alloc] initWithFrame: NSMakeRect(0,0,1,1) mode: NSRadioModeMatrix prototype: bc numberOfRows: 1 numberOfColumns: 4]; [bc release]; [[m cellAtRow: 0 column: 0] setImage: [NSImage imageNamed: @"cursor_line"]]; [[m cellAtRow: 0 column: 1] setImage: [NSImage imageNamed: @"cursor_stroked"]]; [[m cellAtRow: 0 column: 2] setImage: [NSImage imageNamed: @"cursor_filled"]]; [[m cellAtRow: 0 column: 3] setImage: [NSImage imageNamed: @"cursor_inverted"]]; [[m cellAtRow: 0 column: 0] setTag: 0]; [[m cellAtRow: 0 column: 1] setTag: 1]; [[m cellAtRow: 0 column: 2] setTag: 2]; [[m cellAtRow: 0 column: 3] setTag: 3]; s=[[m cellAtRow: 0 column: 0] cellSize]; s.width+=6; s.height+=6; [m setCellSize: s]; [m sizeToCells]; [t putView: m atRow: 0 column: 1 withXMargins: 2 yMargins: 2]; DESTROY(m); } f=[NSTextField newLabel: _(@"Color:")]; [f setAutoresizingMask: NSViewMinXMargin|NSViewMinYMargin|NSViewMaxYMargin]; [t putView: f atRow: 1 column: 0 withXMargins: 2 yMargins: 2]; DESTROY(f); w_cursorColor=w=[[NSColorWell alloc] initWithFrame: NSMakeRect(0,0,40,30)]; [t putView: w atRow: 1 column: 1 withXMargins: 2 yMargins: 2]; DESTROY(w); [[NSColorPanel sharedColorPanel] setShowsAlpha: YES]; [t sizeToFit]; [box setContentView: t]; [box sizeToFit]; [top addView: box enablingYResizing: NO]; DESTROY(box); } [top addView: [[[NSView alloc] init] autorelease] enablingYResizing: YES]; butt=b_useMultiCellGlyphs=[[NSButton alloc] init]; [butt setTitle: _(@"Handle wide (multi-cell) glyphs")]; [butt setButtonType: NSSwitchButton]; [butt sizeToFit]; [top addView: butt enablingYResizing: NO]; DESTROY(butt); butt=b_blackOnWhite=[[NSButton alloc] init]; [butt setTitle: _(@"Display black on white text")]; [butt setButtonType: NSSwitchButton]; [butt sizeToFit]; [top addView: butt enablingYResizing: NO]; DESTROY(butt); hb=[[GSHbox alloc] init]; [hb setDefaultMinXMargin: 4]; [hb setAutoresizingMask: NSViewWidthSizable]; f=[NSTextField newLabel: _(@"Bold font:")]; [f setAutoresizingMask: 0]; [hb addView: f enablingXResizing: NO]; DESTROY(f); f_boldTerminalFont=f=[[NSTextField alloc] init]; [f setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; [f setEditable: NO]; [hb addView: f enablingXResizing: YES]; DESTROY(f); butt=[[NSButton alloc] init]; [butt setTitle: _(@"Pick font...")]; [butt setTarget: self]; [butt setAction: @selector(_pickBoldTerminalFont:)]; [butt sizeToFit]; [hb addView: butt enablingXResizing: NO]; DESTROY(butt); [top addView: hb enablingYResizing: NO]; DESTROY(hb); hb=[[GSHbox alloc] init]; [hb setDefaultMinXMargin: 4]; [hb setAutoresizingMask: NSViewWidthSizable]; f=[NSTextField newLabel: _(@"Normal font:")]; [f setAutoresizingMask: 0]; [hb addView: f enablingXResizing: NO]; DESTROY(f); f_terminalFont=f=[[NSTextField alloc] init]; [f setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; [f setEditable: NO]; [hb addView: f enablingXResizing: YES]; DESTROY(f); butt=[[NSButton alloc] init]; [butt setTitle: _(@"Pick font...")]; [butt setTarget: self]; [butt setAction: @selector(_pickTerminalFont:)]; [butt sizeToFit]; [hb addView: butt enablingXResizing: NO]; DESTROY(butt); [top addView: hb enablingYResizing: NO]; DESTROY(hb); [top addView: [[[NSView alloc] init] autorelease] enablingYResizing: YES]; } [self revert]; } return top; } -(void) dealloc { DESTROY(top); [super dealloc]; } -(void) _pickFont { NSFontManager *fm=[NSFontManager sharedFontManager]; [fm setSelectedFont: [f_cur font] isMultiple: NO]; [fm orderFrontFontPanel: self]; } -(void) _pickTerminalFont: (id)sender { f_cur=f_terminalFont; [self _pickFont]; } -(void) _pickBoldTerminalFont: (id)sender { f_cur=f_boldTerminalFont; [self _pickFont]; } -(void) changeFont: (id)sender { NSFont *f; if (!f_cur) return; f=[sender convertFont: [f_cur font]]; if (!f) return; [f_cur setStringValue: [NSString stringWithFormat: @"%@ %0.1f",[f fontName],[f pointSize]]]; [f_cur setFont: f]; return; } @end static NSString *LoginShellKey=@"LoginShell", *ShellKey=@"Shell"; static NSString *shell; static BOOL loginShell; @implementation TerminalViewShellPrefs +(void) initialize { if (!ud) ud=[NSUserDefaults standardUserDefaults]; if (!shell) { loginShell=[ud boolForKey: LoginShellKey]; shell=[ud stringForKey: ShellKey]; if (!shell && getenv("SHELL")) shell=[NSString stringWithCString: getenv("SHELL")]; if (!shell) shell=@"/bin/sh"; shell=[shell retain]; } } +(NSString *) shell { return shell; } +(BOOL) loginShell { return loginShell; } -(void) save { if (!top) return; if ([b_loginShell state]) loginShell=YES; else loginShell=NO; [ud setBool: loginShell forKey: LoginShellKey]; DESTROY(shell); shell=[[tf_shell stringValue] copy]; [ud setObject: shell forKey: ShellKey]; } -(void) revert { [b_loginShell setState: loginShell]; [tf_shell setStringValue: shell]; } -(NSString *) name { return _(@"Shell"); } -(void) setupButton: (NSButton *)b { [b setTitle: _(@"Shell")]; [b sizeToFit]; } -(void) willHide { } -(NSView *) willShow { if (!top) { top=[[GSVbox alloc] init]; [top setDefaultMinYMargin: 4]; { NSTextField *f; NSButton *b; b=b_loginShell=[[NSButton alloc] init]; [b setAutoresizingMask: NSViewMinYMargin]; [b setTitle: _(@"Start as login-shell")]; [b setButtonType: NSSwitchButton]; [b sizeToFit]; [top addView: b enablingYResizing: YES]; DESTROY(b); tf_shell=f=[[NSTextField alloc] init]; [f sizeToFit]; [f setAutoresizingMask: NSViewWidthSizable]; [top addView: f enablingYResizing: NO]; DESTROY(f); f=[NSTextField newLabel: _(@"Shell:")]; [f setAutoresizingMask: NSViewMaxYMargin]; [f sizeToFit]; [top addView: f enablingYResizing: YES]; DESTROY(f); } [self revert]; } return top; } -(void) dealloc { DESTROY(top); [super dealloc]; } @end static NSString *CommandAsMetaKey=@"CommandAsMeta", *DoubleEscapeKey=@"DoubleEscape", *AltIsNotMetaKey=@"AltIsNotMeta"; static BOOL commandAsMeta,doubleEscape, altIsNotMeta; @implementation TerminalViewKeyboardPrefs +(void) initialize { if (!ud) ud=[NSUserDefaults standardUserDefaults]; commandAsMeta=[ud boolForKey: CommandAsMetaKey]; doubleEscape=[ud boolForKey: DoubleEscapeKey]; altIsNotMeta=[ud boolForKey: AltIsNotMetaKey]; } +(BOOL) commandAsMeta { return commandAsMeta; } +(BOOL) doubleEscape { return doubleEscape; } +(BOOL) altIsNotMeta { return altIsNotMeta; } -(void) save { if (!top) return; if ([b_commandAsMeta state]) commandAsMeta=YES; else commandAsMeta=NO; [ud setBool: commandAsMeta forKey: CommandAsMetaKey]; if ([b_doubleEscape state]) doubleEscape=YES; else doubleEscape=NO; [ud setBool: doubleEscape forKey: DoubleEscapeKey]; if ([b_altIsNotMeta state]) altIsNotMeta=YES; else altIsNotMeta=NO; [ud setBool: altIsNotMeta forKey: AltIsNotMetaKey]; } -(void) revert { [b_commandAsMeta setState: commandAsMeta]; [b_doubleEscape setState: doubleEscape]; [b_altIsNotMeta setState: altIsNotMeta]; } -(NSString *) name { return _(@"Keyboard"); } -(void) setupButton: (NSButton *)b { [b setTitle: _(@"Keyboard")]; [b sizeToFit]; } -(void) willHide { } -(NSView *) willShow { if (!top) { top=[[GSVbox alloc] init]; [top setDefaultMinYMargin: 8]; { NSButton *b; b=b_commandAsMeta=[[NSButton alloc] init]; [b setAutoresizingMask: NSViewMinYMargin|NSViewMaxYMargin|NSViewWidthSizable]; [b setTitle: _(@"Treat the command key as meta.\n" @"\n" @"Note that with this enabled, you won't be\n" @"able to access menu entries with the\n" @"keyboard.")]; [b setButtonType: NSSwitchButton]; [b sizeToFit]; [top addView: b enablingYResizing: YES]; DESTROY(b); b=b_altIsNotMeta=[[NSButton alloc] init]; [b setAutoresizingMask: NSViewMinYMargin|NSViewMaxYMargin|NSViewWidthSizable]; [b setTitle: _(@"Treat the Alt key as Alt and not Meta.\n" @"Useful if command is used as Meta\n" @"And the keyboard has AltGr and not right Alt\n")]; [b setButtonType: NSSwitchButton]; [b sizeToFit]; [top addView: b enablingYResizing: YES]; DESTROY(b); [top addSeparator]; b=b_doubleEscape=[[NSButton alloc] init]; [b setAutoresizingMask: NSViewMinYMargin|NSViewMaxYMargin|NSViewWidthSizable]; [b setTitle: _(@"Send a double escape for the escape key.\n" @"\n" @"This means that the escape key will be\n" @"recognized faster by many programs, but\n" @"you can't use it as a substitute for meta.")]; [b setButtonType: NSSwitchButton]; [b sizeToFit]; [top addView: b enablingYResizing: YES]; DESTROY(b); } [self revert]; } return top; } -(void) dealloc { DESTROY(top); [super dealloc]; } @end Terminal-0.9.8/PreferencesWindowController.h0000644000175000001440000000140411736632073020421 0ustar multixusers/* Copyright 2002 Alexander Malmberg 2012 Free Software Foundation, Inc Authros: Alexander Malmberg Riccardo Mottola This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #import #import "PrefBox.h" @class GSHbox,NSBox; @interface PreferencesWindowController : NSWindowController { GSHbox *button_box; NSBox *pref_box; NSObject *current; NSMutableArray *pref_boxes; NSMutableArray *pref_buttons; } -(void) addPrefBox: (NSObject *)pb; @end Terminal-0.9.8/English.lproj/0000755000175000001440000000000011667362252015274 5ustar multixusersTerminal-0.9.8/English.lproj/Localizable.strings~0000644000175000001440000001652411016341203021313 0ustar multixusers/*** English.lproj/Localizable.strings updated by make_strings 2002-12-09 18:39:08 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:653 */ "Command line:" = "Command line:"; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:78 */ "Apply and save" = "Apply and save"; /* File: PreferencesWindowController.m:122 */ "Preferences" = "Preferences"; /* File: PreferencesWindowController.m:70 */ "Revert" = "Revert"; /*** Strings from Services.m ***/ /* File: Services.m:152 */ "Service aborted by user." = "Service aborted by user."; /* File: Services.m:60 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it."; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Cancel"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /* File: ServicesParameterWindowController.m:118 */ "Parameter for service %@" = "Parameter for service %@"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:585 */ "Accept types" = "Accept types"; /* File: ServicesPrefs.m:499 */ "Add" = "Add"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Error importing services"; /* File: ServicesPrefs.m:401 */ "Export services" = "Export services"; /* File: ServicesPrefs.m:523 */ "Export..." = "Export..."; /* File: ServicesPrefs.m:594 */ "Filenames" = "Filenames"; /* File: ServicesPrefs.m:549 */ "Ignore output" = "Ignore output"; /* File: ServicesPrefs.m:254 */ "Import services" = "Import services"; /* File: ServicesPrefs.m:515 */ "Import..." = "Import..."; /* File: ServicesPrefs.m:559 */ "Input in stdin" = "Input in stdin"; /* File: ServicesPrefs.m:560 */ "Input on command line" = "Input on command line"; /* File: ServicesPrefs.m:640 */ "Key:" = "Key:"; /* File: ServicesPrefs.m:627 */ "Name:" = "Name:"; /* File: ServicesPrefs.m:558 */ "No input" = "No input"; /* File: ServicesPrefs.m:602 */ "Plain text" = "Plain text"; /* File: ServicesPrefs.m:507 */ "Remove" = "Remove"; /* File: ServicesPrefs.m:550 */ "Return output" = "Return output"; /* File: ServicesPrefs.m:568 */ "Run in background" = "Run in background"; /* File: ServicesPrefs.m:570 */ "Run in idle window" = "Run in idle window"; /* File: ServicesPrefs.m:569 */ "Run in new window" = "Run in new window"; /* File: ServicesPrefs.m:468 */ "Terminal services" = "Terminal services"; /* File: ServicesPrefs.m:473 */ "Terminal\nservices" = "Terminal\nservices"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "The file '%@' doesn't contain valid terminal services."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "Unnamed service"; /*** Strings from TerminalParser_LinuxPrefs.m ***/ /* File: TerminalParser_LinuxPrefs.m:103 */ "'linux' terminal parser" = "'linux' terminal parser"; /* File: TerminalParser_LinuxPrefs.m:108 */ "'linux'\nparser" = "'linux'\nparser"; /* File: TerminalParser_LinuxPrefs.m:151 */ "Character set:" = "Character set:"; /* File: TerminalParser_LinuxPrefs.m:43 */ "Chinese" = "Chinese"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Custom, leave unchanged" = "Custom, leave unchanged"; /* File: TerminalParser_LinuxPrefs.m:42 */ "East Europe, latin2" = "East Europe, latin2"; /* File: TerminalParser_LinuxPrefs.m:40 */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:41 */ "West Europe, latin1" = "West Europe, latin1"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1623 */ "Unable to fork: %m." = "Unable to fork: %m."; /* File: TerminalView.m:1611 */ "Unable to open pipe for input: %m." = "Unable to open pipe for input: %m."; /* File: TerminalView.m:1476 */ "[Process exited]" = "[Process exited]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:330 */ "Bold font:" = "Bold font:"; /* File: TerminalViewPrefs.m:298 */ "Color:" = "Color:"; /* File: TerminalViewPrefs.m:277 */ "Cursor" = "Cursor"; /* File: TerminalViewPrefs.m:230 */ /* File: TerminalViewPrefs.m:225 */ "Display" = "Display"; /* File: TerminalViewPrefs.m:291 */ "Filled block" = "Filled block"; /* File: TerminalViewPrefs.m:319 */ "Handle wide (multi-cell) glyphs" = "Handle wide (multi-cell) glyphs"; /* File: TerminalViewPrefs.m:292 */ "Inverted block" = "Inverted block"; /* File: TerminalViewPrefs.m:607 */ /* File: TerminalViewPrefs.m:602 */ "Keyboard" = "Keyboard"; /* File: TerminalViewPrefs.m:289 */ "Line" = "Line"; /* File: TerminalViewPrefs.m:357 */ "Normal font:" = "Normal font:"; /* File: TerminalViewPrefs.m:369 */ /* File: TerminalViewPrefs.m:342 */ "Pick font..." = "Pick font..."; /* File: TerminalViewPrefs.m:255 */ "Scroll-back length in lines:" = "Scroll-back length in lines:"; /* File: TerminalViewPrefs.m:651 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta."; /* File: TerminalViewPrefs.m:492 */ /* File: TerminalViewPrefs.m:487 */ "Shell" = "Shell"; /* File: TerminalViewPrefs.m:527 */ "Shell:" = "Shell:"; /* File: TerminalViewPrefs.m:515 */ "Start as login-shell" = "Start as login-shell"; /* File: TerminalViewPrefs.m:290 */ "Stroked block" = "Stroked block"; /* File: TerminalViewPrefs.m:282 */ "Style:" = "Style:"; /* File: TerminalViewPrefs.m:634 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard."; /*** Strings from TerminalWindow.m ***/ /* File: TerminalWindow.m:192 */ /* File: TerminalWindow.m:188 */ " (idle)" = " (idle)"; /*** Strings from TerminalWindowPrefs.m ***/ /* File: TerminalWindowPrefs.m:192 */ "Add top and bottom border" = "Add top and bottom border"; /* File: TerminalWindowPrefs.m:143 */ "Close new windows when idle" = "Close new windows when idle"; /* File: TerminalWindowPrefs.m:156 */ "Default size" = "Default size"; /* File: TerminalWindowPrefs.m:144 */ "Don't close new windows" = "Don't close new windows"; /* File: TerminalWindowPrefs.m:169 */ "Height:" = "Height:"; /* File: TerminalWindowPrefs.m:112 */ "Terminal Window" = "Terminal Window"; /* File: TerminalWindowPrefs.m:117 */ "Terminal\nWindow" = "Terminal\nWindow"; /* File: TerminalWindowPrefs.m:160 */ "Width:" = "Width:"; /*** Strings from main.m ***/ /* File: main.m:157 */ "Benchmark" = "Benchmark"; /* File: main.m:191 */ "Close" = "Close"; /* File: main.m:180 */ "Copy" = "Copy"; /* File: main.m:177 */ "Cut" = "Cut"; /* File: main.m:186 */ "Edit" = "Edit"; /* File: main.m:203 */ "Hide" = "Hide"; /* File: main.m:159 */ "Info" = "Info"; /* File: main.m:153 */ "Info..." = "Info..."; /* File: main.m:171 */ "New terminal" = "New terminal"; /* File: main.m:183 */ "Paste" = "Paste"; /* File: main.m:155 */ "Preferences..." = "Preferences..."; /* File: main.m:207 */ "Quit" = "Quit"; /* File: main.m:199 */ "Services" = "Services"; /* File: main.m:194 */ "Windows" = "Windows"; Terminal-0.9.8/English.lproj/Localizable.strings0000644000175000001440000002065411324140336021122 0ustar multixusers/*** English.lproj/Localizable.strings updated by make_strings 2010-01-15 20:24:14 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:654 */ "Command line:" = "Command line:"; /* File: TerminalView.m:1130 */ /* Flag: untranslated */ /* File: TerminalView.m:1857 */ /* Flag: untranslated */ "Unexpected error while writing: %m." = "Unexpected error while writing: %m."; /* File: main.m:324 */ /* Flag: untranslated */ /* File: main.m:345 */ /* Flag: untranslated */ "Quit?" = "Quit?"; /*** Unmatched/untranslated keys ***/ /* File: TerminalView.m:1992 */ /* Flag: untranslated */ "Unable to set non-blocking mode: %m." = "Unable to set non-blocking mode: %m."; /* File: TerminalViewPrefs.m:289 */ /* Flag: unmatched */ "Line" = "Line"; /* File: TerminalViewPrefs.m:290 */ /* Flag: unmatched */ "Stroked block" = "Stroked block"; /* File: TerminalViewPrefs.m:291 */ /* Flag: unmatched */ "Filled block" = "Filled block"; /* File: TerminalViewPrefs.m:292 */ /* Flag: unmatched */ "Inverted block" = "Inverted block"; /* File: TerminalViewPrefs.m:397 */ /* Flag: untranslated */ "Display black on white text" = "Display black on white text"; /* File: main.m:189 */ /* Flag: untranslated */ "Miniaturize all" = "Miniaturize all"; /* File: main.m:275 */ /* Flag: untranslated */ "Quit anyway" = "Quit anyway"; /* File: main.m:283 */ /* Flag: untranslated */ "Don't quit" = "Don't quit"; /* File: main.m:300 */ /* Flag: untranslated */ "There are active windows. Quitting will close them." = "There are active windows. Quitting will close them."; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:95 */ "Apply and save" = "Apply and save"; /* File: PreferencesWindowController.m:140 */ "Preferences" = "Preferences"; /* File: PreferencesWindowController.m:87 */ "Revert" = "Revert"; /*** Strings from Services.m ***/ /* File: Services.m:151 */ "Service aborted by user." = "Service aborted by user."; /* File: Services.m:59 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it."; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Cancel"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /* File: ServicesParameterWindowController.m:118 */ "Parameter for service %@" = "Parameter for service %@"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:586 */ "Accept types" = "Accept types"; /* File: ServicesPrefs.m:500 */ "Add" = "Add"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Error importing services"; /* File: ServicesPrefs.m:401 */ "Export services" = "Export services"; /* File: ServicesPrefs.m:524 */ "Export..." = "Export..."; /* File: ServicesPrefs.m:595 */ "Filenames" = "Filenames"; /* File: ServicesPrefs.m:550 */ "Ignore output" = "Ignore output"; /* File: ServicesPrefs.m:254 */ "Import services" = "Import services"; /* File: ServicesPrefs.m:516 */ "Import..." = "Import..."; /* File: ServicesPrefs.m:560 */ "Input in stdin" = "Input in stdin"; /* File: ServicesPrefs.m:561 */ "Input on command line" = "Input on command line"; /* File: ServicesPrefs.m:641 */ "Key:" = "Key:"; /* File: ServicesPrefs.m:628 */ "Name:" = "Name:"; /* File: ServicesPrefs.m:559 */ "No input" = "No input"; /* File: ServicesPrefs.m:603 */ "Plain text" = "Plain text"; /* File: ServicesPrefs.m:508 */ "Remove" = "Remove"; /* File: ServicesPrefs.m:551 */ "Return output" = "Return output"; /* File: ServicesPrefs.m:569 */ "Run in background" = "Run in background"; /* File: ServicesPrefs.m:571 */ "Run in idle window" = "Run in idle window"; /* File: ServicesPrefs.m:570 */ "Run in new window" = "Run in new window"; /* File: ServicesPrefs.m:469 */ "Terminal services" = "Terminal services"; /* File: ServicesPrefs.m:474 */ "Terminal\nservices" = "Terminal\nservices"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "The file '%@' doesn't contain valid terminal services."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "Unnamed service"; /*** Strings from TerminalParser_LinuxPrefs.m ***/ /* File: TerminalParser_LinuxPrefs.m:104 */ "'linux' terminal parser" = "'linux' terminal parser"; /* File: TerminalParser_LinuxPrefs.m:109 */ "'linux'\nparser" = "'linux'\nparser"; /* File: TerminalParser_LinuxPrefs.m:152 */ "Character set:" = "Character set:"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Chinese" = "Chinese"; /* File: TerminalParser_LinuxPrefs.m:45 */ "Custom, leave unchanged" = "Custom, leave unchanged"; /* File: TerminalParser_LinuxPrefs.m:43 */ "East Europe, latin2" = "East Europe, latin2"; /* File: TerminalParser_LinuxPrefs.m:41 */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:42 */ "West Europe, latin1" = "West Europe, latin1"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1965 */ "Unable to fork: %m." = "Unable to fork: %m."; /* File: TerminalView.m:1953 */ "Unable to open pipe for input: %m." = "Unable to open pipe for input: %m."; /* File: TerminalView.m:1765 */ "[Process exited]" = "[Process exited]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:408 */ "Bold font:" = "Bold font:"; /* File: TerminalViewPrefs.m:367 */ "Color:" = "Color:"; /* File: TerminalViewPrefs.m:322 */ "Cursor" = "Cursor"; /* File: TerminalViewPrefs.m:273 */ /* File: TerminalViewPrefs.m:268 */ "Display" = "Display"; /* File: TerminalViewPrefs.m:390 */ "Handle wide (multi-cell) glyphs" = "Handle wide (multi-cell) glyphs"; /* File: TerminalViewPrefs.m:690 */ /* File: TerminalViewPrefs.m:685 */ "Keyboard" = "Keyboard"; /* File: TerminalViewPrefs.m:435 */ "Normal font:" = "Normal font:"; /* File: TerminalViewPrefs.m:447 */ /* File: TerminalViewPrefs.m:420 */ "Pick font..." = "Pick font..."; /* File: TerminalViewPrefs.m:299 */ "Scroll-back length in lines:" = "Scroll-back length in lines:"; /* File: TerminalViewPrefs.m:730 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta."; /* File: TerminalViewPrefs.m:577 */ /* File: TerminalViewPrefs.m:572 */ "Shell" = "Shell"; /* File: TerminalViewPrefs.m:610 */ "Shell:" = "Shell:"; /* File: TerminalViewPrefs.m:598 */ "Start as login-shell" = "Start as login-shell"; /* File: TerminalViewPrefs.m:327 */ "Style:" = "Style:"; /* File: TerminalViewPrefs.m:715 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard."; /*** Strings from TerminalWindow.m ***/ /* File: TerminalWindow.m:203 */ /* File: TerminalWindow.m:199 */ " (idle)" = " (idle)"; /*** Strings from TerminalWindowPrefs.m ***/ /* File: TerminalWindowPrefs.m:212 */ "Add top and bottom border" = "Add top and bottom border"; /* File: TerminalWindowPrefs.m:152 */ "Close new windows when idle" = "Close new windows when idle"; /* File: TerminalWindowPrefs.m:176 */ "Default size" = "Default size"; /* File: TerminalWindowPrefs.m:153 */ "Don't close new windows" = "Don't close new windows"; /* File: TerminalWindowPrefs.m:189 */ "Height:" = "Height:"; /* File: TerminalWindowPrefs.m:114 */ "Terminal Window" = "Terminal Window"; /* File: TerminalWindowPrefs.m:119 */ "Terminal\nWindow" = "Terminal\nWindow"; /* File: TerminalWindowPrefs.m:180 */ "Width:" = "Width:"; /*** Strings from main.m ***/ /* File: main.m:152 */ "Benchmark" = "Benchmark"; /* File: main.m:186 */ "Close" = "Close"; /* File: main.m:175 */ "Copy" = "Copy"; /* File: main.m:172 */ "Cut" = "Cut"; /* File: main.m:181 */ "Edit" = "Edit"; /* File: main.m:201 */ "Hide" = "Hide"; /* File: main.m:154 */ "Info" = "Info"; /* File: main.m:148 */ "Info..." = "Info..."; /* File: main.m:166 */ "New terminal" = "New terminal"; /* File: main.m:178 */ "Paste" = "Paste"; /* File: main.m:150 */ "Preferences..." = "Preferences..."; /* File: main.m:205 */ "Quit" = "Quit"; /* File: main.m:197 */ "Services" = "Services"; /* File: main.m:192 */ "Windows" = "Windows"; Terminal-0.9.8/GNUmakefile0000644000175000001440000000323111736632073014625 0ustar multixusers# copyright 2002-2003 Alexander Malmberg # copyright 2008-2009 Riccardo Mottola # # This file is a part of Terminal.app. Terminal.app is free software; you # can redistribute it and/or modify it under the terms of the GNU General # Public License as published by the Free Software Foundation; version 2 # of the License. See COPYING or main.m for more information. include $(GNUSTEP_MAKEFILES)/common.make APP_NAME = Terminal PACKAGE_NAME = Terminal VERSION = 0.9.8 # Useful warnings: # -W -Wformat=2 -Wno-sign-compare -Wpointer-arith \ # -Wbad-function-cast -Wcast-align -Wwrite-strings -Wstrict-prototypes \ # -Wmissing-prototypes -Wmissing-declarations \ # -Wnested-externs -Wno-unused-parameter Terminal_OBJC_FILES = \ main.m \ \ Services.m \ ServicesPrefs.m \ ServicesParameterWindowController.m \ \ TerminalWindow.m \ TerminalWindowPrefs.m \ \ TerminalView.m \ TerminalViewPrefs.m \ \ TerminalParser_Linux.m \ TerminalParser_LinuxPrefs.m \ \ PreferencesWindowController.m \ autokeyviewchain.m \ \ Label.m ifeq ($(findstring solaris, $(GNUSTEP_TARGET_OS)), solaris) Terminal_TOOL_LIBS += -liconv else Terminal_TOOL_LIBS += -lutil endif Terminal_LOCALIZED_RESOURCE_FILES = Localizable.strings Terminal_LANGUAGES = English Swedish German French Spanish Hungarian Turkish \ Norwegian Russian Italian Terminal_APPLICATION_ICON = Terminal.tiff Terminal_RESOURCE_FILES = \ Terminal.tiff DefaultTerminalServices.svcs \ cursor_line.tiff cursor_stroked.tiff cursor_filled.tiff \ cursor_inverted.tiff TerminalInfo.plist MAKE_STRINGS_OPTIONS = --aggressive-match --aggressive-remove include $(GNUSTEP_MAKEFILES)/application.make Terminal-0.9.8/TerminalParser_LinuxPrefs.m0000644000175000001440000000661111363661336020045 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #import #import #import #import #import #import #import #import #import "Label.h" #import "TerminalParser_LinuxPrefs.h" static NSUserDefaults *ud; NSString *TerminalParser_LinuxPrefsDidChangeNotification= @"TerminalParser_LinuxPrefsDidChangeNotification"; static NSString *CharacterSetKey=@"Linux_CharacterSet"; static NSString *characterSet; typedef struct { NSString *name; NSString *display_name; } character_set_choice_t; static character_set_choice_t cs_choices[]={ {@"utf-8" ,__(@"UTF-8")}, {@"iso-8859-1" ,__(@"West Europe, latin1")}, {@"iso-8859-2" ,__(@"East Europe, latin2")}, {@"big-5" ,__(@"Chinese")}, {nil ,__(@"Custom, leave unchanged")}, {nil,nil} }; @implementation TerminalParser_LinuxPrefs +(void) initialize { if (!ud) { ud=[NSUserDefaults standardUserDefaults]; characterSet=[[ud stringForKey: CharacterSetKey] retain]; if (!characterSet) characterSet=@"iso-8859-1"; } } +(const char *) characterSet { return [characterSet cString]; } -(void) save { int i; if (!top) return; i=[pb_characterSet indexOfSelectedItem]; if (cs_choices[i].name!=nil) { ASSIGN(characterSet,cs_choices[i].name); [ud setObject: characterSet forKey: CharacterSetKey]; [[NSNotificationCenter defaultCenter] postNotificationName: TerminalParser_LinuxPrefsDidChangeNotification object: self]; } } -(void) revert { int i; character_set_choice_t *c; for (i=0,c=cs_choices;c->name;i++,c++) { if (c->name && [c->name caseInsensitiveCompare: characterSet]==NSOrderedSame) break; } [pb_characterSet selectItemAtIndex: i]; } -(NSString *) name { return _(@"'linux' terminal parser"); } -(void) setupButton: (NSButton *)b { [b setTitle: _(@"'linux'\nparser")]; [b sizeToFit]; } -(void) willHide { } -(NSView *) willShow { if (!top) { GSVbox *top2; top2=[[GSVbox alloc] init]; top=[[GSVbox alloc] init]; [top setAutoresizingMask: NSViewMinXMargin|NSViewMaxXMargin|NSViewMinYMargin|NSViewMaxYMargin]; [top setDefaultMinYMargin: 2]; { NSTextField *f; NSPopUpButton *pb; int i; character_set_choice_t *c; pb_characterSet=pb=[[NSPopUpButton alloc] init]; [pb setAutoresizingMask: NSViewMinXMargin|NSViewMaxXMargin]; [pb setAutoenablesItems: NO]; for (i=0,c=cs_choices;c->display_name;i++,c++) { NSString *name; if (c->name) name=[NSString stringWithFormat: @"%@ (%@)", _(c->display_name),c->name]; else name=_(c->display_name); [pb addItemWithTitle: name]; } [pb sizeToFit]; [top addView: pb enablingYResizing: NO]; DESTROY(pb); f=[NSTextField newLabel: _(@"Character set:")]; [top addView: f enablingYResizing: NO]; DESTROY(f); } [top2 addView: top enablingYResizing: YES]; DESTROY(top); top=top2; [self revert]; } return top; } -(void) dealloc { DESTROY(top); [super dealloc]; } @end Terminal-0.9.8/TerminalInfo.plist0000644000175000001440000000103211736632073016214 0ustar multixusers{ ApplicationDescription = "A Terminal Emulator"; ApplicationIcon = Terminal; ApplicationName = Terminal; ApplicationRelease = "0.9.8"; ApplicationURL = "http://gap.nongnu.org/terminal/index.html"; Authors = ("Alexander Malmberg ","Gregory Casamento ","Riccardo Mottola "); Copyright = "Copyright \u00a9 2002-2003, 2009-2012"; CopyrightDescription = "Released under the GNU GPL. See COPYING for details."; FullVersionID = "0.9.7"; } Terminal-0.9.8/TerminalWindowPrefs.h0000644000175000001440000000135211016341203016650 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef TerminalWindowPrefs_h #define TerminalWindowPrefs_h #include "PrefBox.h" @class GSVbox,NSTextField,NSButton,NSMatrix; @interface TerminalWindowPrefs : NSObject { GSVbox *top; NSMatrix *m_close; NSTextField *tf_width,*tf_height; NSButton *b_addYBorders; } +(int) windowCloseBehavior; +(int) defaultWindowWidth; +(int) defaultWindowHeight; +(BOOL) addYBorders; @end #endif Terminal-0.9.8/Label.h0000644000175000001440000000073211374617442013747 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #import #import @interface NSTextField (label) + newLabel: (NSString *)title; @end Terminal-0.9.8/PreferencesWindowController.m0000644000175000001440000001333311736632073020432 0ustar multixusers/* Copyright 2002, 2003 Alexander Malmberg Copyright 2009-2012 Free Software Foundation Inc. Authors: Alexander Malmberg Riccardo Mottola This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import "autokeyviewchain.h" #import "PreferencesWindowController.h" #import "PrefBox.h" /* Changing the font in TerminalViewPrefs won't work unless the panel can be the main window (the font panel gets confused about where to send the -changeFont:), hence this class. When per-window preferences are done, this won't be necessary. */ @interface PreferencesPanel : NSPanel @end @implementation PreferencesPanel -(BOOL) canBecomeMainWindow { return YES; } @end @implementation PreferencesWindowController -(void) save: (id)sender { [pref_boxes makeObjectsPerformSelector: @selector(save)]; } -(void) revert: (id)sender { [pref_boxes makeObjectsPerformSelector: @selector(revert)]; } - init { NSWindow *win; win=[[PreferencesPanel alloc] initWithContentRect: NSMakeRect(100,100,290,400) styleMask: NSClosableWindowMask|NSTitledWindowMask|NSResizableWindowMask|NSMiniaturizableWindowMask backing: NSBackingStoreRetained defer: YES]; if (!(self=[super initWithWindow: win])) return nil; { GSVbox *vbox; vbox=[[GSVbox alloc] init]; [vbox setBorder: 4]; [vbox setDefaultMinYMargin: 4]; { NSButton *b; GSHbox *hbox; hbox=[[GSHbox alloc] init]; [hbox setDefaultMinXMargin: 4]; [hbox setAutoresizingMask: NSViewMinXMargin]; b=[[NSButton alloc] init]; [b setTitle: _(@"Revert")]; [b setTarget: self]; [b setAction: @selector(revert:)]; [b sizeToFit]; [hbox addView: b]; [b release]; b=[[NSButton alloc] init]; [b setTitle: _(@"Apply and save")]; [b setKeyEquivalent: @"\r"]; [b setTarget: self]; [b setAction: @selector(save:)]; [b sizeToFit]; [hbox addView: b]; [b release]; [vbox addView: hbox enablingYResizing: NO]; [hbox release]; } { pref_box=[[NSBox alloc] initWithFrame: NSMakeRect(0,0,1,1)]; [pref_box setTitle: @""]; [pref_box setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; [pref_box setAutoresizesSubviews: YES]; [vbox addView: pref_box enablingYResizing: YES]; } { NSScrollView *sv; NSSize s; button_box=[[GSHbox alloc] init]; s=[NSScrollView frameSizeForContentSize: NSMakeSize(1,68) hasHorizontalScroller: YES hasVerticalScroller: YES borderType: NSNoBorder]; /* TODO? */ sv=[[NSScrollView alloc] initWithFrame: NSMakeRect(0,0,1,s.height)]; [sv setDocumentView: button_box]; [sv setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; [sv setHasHorizontalScroller: YES]; [sv setBorderType: NSBezelBorder]; [vbox addView: sv enablingYResizing: NO]; DESTROY(sv); } [win setContentView: vbox]; [vbox release]; } [win setDelegate: self]; [win setTitle: _(@"Preferences")]; [win setMinSize: NSMakeSize(410,430)]; [win setFrameUsingName: @"Preferences"]; [win setFrameAutosaveName: @"Preferences"]; [win autoSetupKeyViewChain]; [win release]; pref_boxes=[[NSMutableArray alloc] init]; pref_buttons=[[NSMutableArray alloc] init]; return self; } -(void) dealloc { if (current) { [current willHide]; current=nil; } DESTROY(pref_boxes); DESTROY(pref_buttons); DESTROY(button_box); [super dealloc]; } -(void) _displayBox: (NSObject *)pb { NSUInteger idx; idx = [pref_boxes indexOfObjectIdenticalTo: pb]; if (idx==NSNotFound) return; if (current==pb) return; if (current) { [[pref_buttons objectAtIndex: [pref_boxes indexOfObjectIdenticalTo: current]] setState: 0]; [current willHide]; current=nil; } [[pref_buttons objectAtIndex: idx] setState: 1]; [pref_box setTitle: [pb name]]; [pref_box setContentView: [pb willShow]]; current=pb; [[self window] autoSetupKeyViewChain]; } -(void) _displayBoxButton: (id)sender { NSUInteger idx; idx = [pref_buttons indexOfObjectIdenticalTo: sender]; if (idx==NSNotFound) return; if ([pref_boxes objectAtIndex: idx]==current) { [sender setState: 1]; return; } [self _displayBox: [pref_boxes objectAtIndex: idx]]; } -(void) addPrefBox: (NSObject *)pb { NSButton *b=[[NSButton alloc] init]; [pref_boxes addObject: pb]; [pref_buttons addObject: b]; [pb setupButton: b]; if ([b frame].size.height<=64) [b setFrame: NSMakeRect(0,0,[b frame].size.width,64)]; [b setTarget: self]; [b setAction: @selector(_displayBoxButton:)]; [b setButtonType: NSPushOnPushOffButton]; [button_box addView: b]; [b release]; [button_box sizeToFit]; if (!current) [self _displayBox: pb]; else [[self window] autoSetupKeyViewChain]; } /* well, it works */ -(BOOL) respondsToSelector: (SEL)s { if ([super respondsToSelector: s]) return YES; if (current) return [current respondsToSelector: s]; return NO; } -(void) forwardInvocation: (NSInvocation *)i { if (current) if ([current respondsToSelector: [i selector]]) { [i invokeWithTarget: current]; return; } [super forwardInvocation: i]; } -(NSMethodSignature *) methodSignatureForSelector: (SEL)sel { return [super methodSignatureForSelector: sel]; } @end Terminal-0.9.8/TerminalWindow.h0000644000175000001440000000157111016341203015653 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef TerminalWindow_h #define TerminalWindow_h @class TerminalView; #include NSString *TerminalWindowNoMoreActiveWindowsNotification; @interface TerminalWindowController : NSWindowController { TerminalView *tv; BOOL close_on_idle; } +(TerminalWindowController *) newTerminalWindow; +(TerminalWindowController *) idleTerminalWindow; +(int) numberOfActiveWindows; +(void) checkActiveWindows; - init; -(TerminalView *) terminalView; -(void) setShouldCloseWhenIdle: (BOOL)should_close; @end #endif Terminal-0.9.8/autokeyviewchain.m0000644000175000001440000000347111016341203016275 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #include #include #include #include "autokeyviewchain.h" @implementation NSWindow (autokeyviewchain) -(void) autoSetupKeyViewChain { NSView *v=[self contentView]; [self setInitialFirstResponder: [v autoSetupKeyViewChain: nil]]; /* { NSView *v=[self initialFirstResponder]; printf("window %p initial=%p\n",self,v); for (;v;v=[v nextKeyView]) { printf(" '%@'\n",v); } }*/ } @end /* just to get rid of warnings */ #include #include @implementation NSView (autokeyviewchain) -(NSView *) autoSetupKeyViewChain: (NSView *) next { if ([self acceptsFirstResponder]) { [self setNextKeyView: next]; next=self; } /* use NSScrollView to get rid of warning */ if ([self respondsToSelector: @selector(documentView)]) next=[[(NSScrollView *)self documentView] autoSetupKeyViewChain: next]; else if ([self respondsToSelector: @selector(contentView)]) next=[[(NSScrollView *)self contentView] autoSetupKeyViewChain: next]; return next; } @end #include @implementation GSTable (autokeyviewchain) -(NSView *) autoSetupKeyViewChain: (NSView *) next { int i,j; NSView *v; for (i=0;i<_numberOfRows;i++) { for (j=_numberOfColumns-1;j>=0;j--) { if (_jails[i*_numberOfColumns+j]) { v=[[(NSView *)_jails[i*_numberOfColumns+j] subviews] objectAtIndex: 0]; next=[v autoSetupKeyViewChain: next]; } } } return next; } @end Terminal-0.9.8/ServicesParameterWindowController.h0000644000175000001440000000132711016341203021567 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef ServicesParameterWindowController_h #define ServicesParameterWindowController_h #include @class NSTextField; @interface TerminalServicesParameterWindowController : NSWindowController { NSTextField *tf_cmdline; } +(NSString *) getCommandlineFrom: (NSString *)cmdline selectRange: (NSRange)r service: (NSString *)service_name; @end #endif Terminal-0.9.8/autokeyviewchain.h0000644000175000001440000000110011016341203016253 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef autokeyviewchain_h #define autokeyviewchain_h @interface NSWindow (autokeyviewchain) -(void) autoSetupKeyViewChain; @end @interface NSView (autokeyviewchain) -(NSView *) autoSetupKeyViewChain: (NSView *) next; @end #endif Terminal-0.9.8/Terminal.h0000644000175000001440000000350311016341203014460 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef Terminal_h #define Terminal_h typedef struct { unichar ch; unsigned char color; unsigned char attr; /* bits 0,1 intensity, 0-2 2 underline 3 reverse 4 blink 5 unused 6 used as a selected flag internally 7 used as a dirty flag internally */ } screen_char_t; /* Used as a marker. */ #define MULTI_CELL_GLYPH 0xfffe @protocol TerminalScreen -(void) ts_sendCString: (const char *)str; -(void) ts_sendCString: (const char *)msg length: (int)len; -(void) ts_goto: (int)x:(int)y; -(void) ts_putChar: (screen_char_t)ch count: (int)c at: (int)x:(int)y; -(void) ts_putChar: (screen_char_t)ch count: (int)c offset: (int)ofs; /* The portions scrolled/shifted from remain unchanged. However, it's assumed that they will be cleared or overwritten before the redraw is complete. (TODO check this) */ -(void) ts_scrollUp: (int)top:(int)bottom rows: (int)nr save: (BOOL)save; -(void) ts_scrollDown: (int)top:(int)bottom rows: (int)nr; -(void) ts_shiftRow: (int)y at: (int)x0 delta: (int)d; -(screen_char_t) ts_getCharAt: (int)x:(int)y; -(void) ts_setTitle: (NSString *)new_title type: (int)title_type; -(BOOL) useMultiCellGlyphs; -(int) relativeWidthOfCharacter: (unichar)ch; @end @protocol TerminalParser - initWithTerminalScreen: (id)ats width: (int)w height: (int)h; -(void) processByte: (unsigned char)c; -(void) setTerminalScreenWidth: (int)w height: (int)h; -(void) handleKeyEvent: (NSEvent *)e; -(void) sendString: (NSString *)str; @end #endif Terminal-0.9.8/TerminalParser_Linux.m0000644000175000001440000007156011736632073017052 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg 2009-2011 GAP Project This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ /* lots borrowed from linux/drivers/char/console.c, GNU GPL:ed */ /* * linux/drivers/char/console.c * * Copyright (C) 1991, 1992 Linus Torvalds */ #import #import #import #import #include /* TODO */ #import "TerminalViewPrefs.h" #import #import "TerminalParser_Linux.h" #import "TerminalParser_LinuxPrefs.h" #include "charmaps.h" #define set_translate(charset,foo) _set_translate(charset) static const unichar *_set_translate(int charset) { if (charset<0 || charset>=4) return translate_maps[0]; return translate_maps[charset]; } @interface TerminalParser_Linux (private) #define csi_J(foo,vpar) [self _csi_J: vpar] #define csi_K(foo,vpar) [self _csi_K: vpar] #define csi_L(foo,vpar) [self _csi_L: vpar] #define csi_M(foo,vpar) [self _csi_M: vpar] #define csi_P(foo,vpar) [self _csi_P: vpar] #define csi_X(foo,vpar) [self _csi_X: vpar] #define csi_at(foo,vpar) [self _csi_at: vpar] #define csi_m(foo) [self _csi_m] -(void) _csi_J: (int)vpar; -(void) _csi_K: (int)vpar; -(void) _csi_L: (unsigned int)vpar; -(void) _csi_M: (unsigned int)vpar; -(void) _csi_P: (unsigned int)vpar; -(void) _csi_X: (int)vpar; -(void) _csi_at: (unsigned int)vpar; -(void) _csi_m; -(void) _default_attr; -(void) _update_attr; @end #define SCREEN(x,y) ((x)+(y)*width) @implementation TerminalParser_Linux #define gotoxy(foo,new_x,new_y) do { \ int min_y, max_y; \ \ if (new_x < 0) \ x = 0; \ else \ if (new_x >= width) \ x = width - 1; \ else \ x = new_x; \ if (decom) { \ min_y = top; \ max_y = bottom; \ } else { \ min_y = 0; \ max_y = height; \ } \ if (new_y < min_y) \ y = min_y; \ else if (new_y >= max_y) \ y = max_y - 1; \ else \ y = new_y; \ [ts ts_goto: x:y]; \ } while (0) #define gotoxay(foo,nx,ny) gotoxy(foo,nx,decom?top+ny:ny) #define save_cur(foo) do { \ saved_x = x; \ saved_y = y; \ s_intensity = intensity; \ s_underline = underline; \ s_blink = blink; \ s_reverse = reverse; \ s_charset = charset; \ s_color = color; \ saved_G0 = G0_charset; \ saved_G1 = G1_charset; \ } while (0) #define restore_cur(foo) do { \ gotoxy(currcons,saved_x,saved_y); \ intensity = s_intensity; \ underline = s_underline; \ blink = s_blink; \ reverse = s_reverse; \ charset = s_charset; \ color = s_color; \ G0_charset = saved_G0; \ G1_charset = saved_G1; \ translate = set_translate(charset ? G1_charset : G0_charset,currcons); \ } while (0) -(void) _reset_terminal { top = 0; bottom = height; vc_state = ESnormal; ques = 0; translate = set_translate(LAT1_MAP,currcons); G0_charset = LAT1_MAP; G1_charset = GRAF_MAP; charset = 0; // report_mouse = 0; utf = 0; utf_count = 0; disp_ctrl = 0; toggle_meta = 0; decscnm = 0; decom = 0; decawm = 1; deccm = 1; decim = 0; #if 0 set_kbd(decarm); clr_kbd(decckm); clr_kbd(kbdapplic); clr_kbd(lnm); kbd_table[currcons].lockstate = 0; kbd_table[currcons].slockstate = 0; kbd_table[currcons].ledmode = LED_SHOW_FLAGS; kbd_table[currcons].ledflagstate = kbd_table[currcons].default_ledflagstate; set_leds(); cursor_type = CUR_DEFAULT; complement_mask = s_complement_mask; #endif [self _default_attr]; [self _update_attr]; tab_stop[0]= 0x01010100; tab_stop[1]=tab_stop[2]=tab_stop[3]=tab_stop[4]= tab_stop[5]=tab_stop[6]=tab_stop[7]=0x01010101; gotoxy(currcons,0,0); save_cur(currcons); [self _csi_J: 2]; } -(void) _csi_J: (int) vpar { unsigned int count; int start; switch (vpar) { case 0: /* erase from cursor to end of display */ count = width*height-(x+y*width); start = SCREEN(x,y); break; case 1: /* erase from start to cursor */ count = x+y*width+1; start = SCREEN(0,0); break; case 2: /* erase whole display */ count = width*height; start = SCREEN(0,0); break; default: return; } [ts ts_putChar: video_erase_char count: count offset: start]; } -(void) _csi_K: (int)vpar { unsigned int count; int start; switch (vpar) { case 0: /* erase from cursor to end of line */ count = width-x; start = SCREEN(x,y); break; case 1: /* erase from start of line to cursor */ count = x+1; start = SCREEN(0,y); break; case 2: /* erase whole line */ count = width; start = SCREEN(0,y); break; default: return; } [ts ts_putChar: video_erase_char count: count offset: start]; } -(void) _csi_X: (int)vpar /* erase the following vpar positions */ { /* not vt100? */ int count; if (!vpar) vpar++; count = (vpar > width-x) ? (width-x) : vpar; [ts ts_putChar: video_erase_char count: count offset: SCREEN(x,y)]; } -(void) _default_attr { intensity = 1; underline = 0; reverse = 0; blink = 0; color = def_color; } -(void) _update_attr { video_erase_char.color=color; video_erase_char.attr=(intensity)|(underline<<2)|(reverse<<3)|(blink<<4); } static unsigned char color_table[] = { 0, 4, 2, 6, 1, 5, 3, 7, 8,12,10,14, 9,13,11,15 }; -(void) _csi_m { int i; for (i=0;i<=npar;i++) switch (par[i]) { case 0: /* all attributes off */ [self _default_attr]; break; case 1: intensity = 2; break; case 2: intensity = 0; break; case 4: underline = 1; break; case 5: blink = 1; break; case 7: reverse = 1; break; case 10: /* ANSI X3.64-1979 (SCO-ish?) * Select primary font, don't display * control chars if defined, don't set * bit 8 on output. */ translate = set_translate(charset == 0 ? G0_charset : G1_charset,currcons); disp_ctrl = 0; toggle_meta = 0; break; case 11: /* ANSI X3.64-1979 (SCO-ish?) * Select first alternate font, lets * chars < 32 be displayed as ROM chars. */ translate = set_translate(IBMPC_MAP,currcons); disp_ctrl = 1; toggle_meta = 0; break; case 12: /* ANSI X3.64-1979 (SCO-ish?) * Select second alternate font, toggle * high bit before displaying as ROM char. */ translate = set_translate(IBMPC_MAP,currcons); disp_ctrl = 1; toggle_meta = 1; break; case 21: case 22: intensity = 1; break; case 24: underline = 0; break; case 25: blink = 0; break; case 27: reverse = 0; break; case 38: /* ANSI X3.64-1979 (SCO-ish?) * Enables underscore, white foreground * with white underscore (Linux - use * default foreground). */ color = (def_color & 0x0f) | background; underline = 1; break; case 39: /* ANSI X3.64-1979 (SCO-ish?) * Disable underline option. * Reset colour to default? It did this * before... */ color = (def_color & 0x0f) | background; underline = 0; break; case 49: color = (def_color & 0xf0) | foreground; break; default: if (par[i] >= 30 && par[i] <= 37) color = color_table[par[i]-30] | background; else if (par[i] >= 40 && par[i] <= 47) color = (color_table[par[i]-40]<<4) | foreground; break; } [self _update_attr]; } #define scrup(foo,t,b,nr,indirect_scroll) do { \ int scrup_nr=nr; \ \ if (t+scrup_nr >= b) \ scrup_nr = b - t - 1; \ if (b > height || t >= b || scrup_nr < 1) \ return; \ [ts ts_scrollUp: t:b rows: scrup_nr save: indirect_scroll]; \ [ts ts_putChar: video_erase_char count: width*scrup_nr offset: width*(b-scrup_nr)]; \ } while (0) #define scrdown(foo,t,b,nr) do { \ unsigned int step; \ int scrdown_nr=nr; \ \ if (t+scrdown_nr >= b) \ scrdown_nr = b - t - 1; \ if (b > height || t >= b || scrdown_nr < 1) \ return; \ step = width * scrdown_nr; \ [ts ts_scrollDown: t:b rows: scrdown_nr]; \ [ts ts_putChar: video_erase_char count: step offset: t*width]; \ } while (0) #define insert_char(foo,nr) do { \ [ts ts_shiftRow: y at: x delta: nr]; \ [ts ts_putChar: video_erase_char count: nr at: x:y]; \ } while (0) #define delete_char(foo,nr) do { \ [ts ts_shiftRow: y at: x+nr delta: -nr]; \ [ts ts_putChar: video_erase_char count: nr at: width-nr:y]; \ } while (0) -(void) _csi_at: (unsigned int)nr { if (nr > width - x) nr = width - x; else if (!nr) nr = 1; insert_char(currcons, nr); } -(void) _csi_L: (unsigned int)nr { if (nr > height - y) nr = height - y; else if (!nr) nr = 1; scrdown(foo,y,bottom,nr); } -(void) _csi_P: (unsigned int)nr { if (nr > width - x) nr = width - x; else if (!nr) nr = 1; delete_char(currcons, nr); } -(void) _csi_M: (unsigned int)nr { if (nr > height - y) nr = height - y; else if (!nr) nr=1; scrup(foo,y,bottom,nr,NO); } #define set_kbd(foo) #define clr_kbd(foo) #define set_mode(foo,on_off) [self _set_mode: on_off] -(void) _set_mode: (int) on_off { int i; for (i=0; i<=npar; i++) if (ques) switch(par[i]) { /* DEC private modes set/reset */ case 1: /* Cursor keys send ^[Ox/^[[x */ if (on_off) { set_kbd(decckm); } else { clr_kbd(decckm); } break; case 3: /* 80/132 mode switch unimplemented */ NSDebugLLog(@"term",@"ignore _set_mode 3"); #if 0 deccolm = on_off; (void) vc_resize(height, deccolm ? 132 : 80); /* this alone does not suffice; some user mode utility has to change the hardware regs */ #endif break; case 5: /* Inverted screen on/off */ if (decscnm != on_off) { decscnm = on_off; [self _update_attr]; /* TODO? */ } break; case 6: /* Origin relative/absolute */ decom = on_off; gotoxay(currcons,0,0); break; case 7: /* Autowrap on/off */ decawm = on_off; break; case 8: /* Autorepeat on/off */ NSDebugLLog(@"term",@"ignore _set_mode 8"); #if 0 if (on_off) set_kbd(decarm); else clr_kbd(decarm); #endif break; case 9: NSDebugLLog(@"term",@"ignore _set_mode 9"); #if 0 report_mouse = on_off ? 1 : 0; #endif break; case 25: /* Cursor on/off */ deccm = on_off; break; case 1000: NSDebugLLog(@"term",@"ignore _set_mode 1000"); #if 0 report_mouse = on_off ? 2 : 0; #endif break; } else switch(par[i]) { /* ANSI modes set/reset */ case 3: /* Monitor (display ctrls) */ disp_ctrl = on_off; break; case 4: /* Insert Mode on/off */ decim = on_off; break; case 20: /* Lf, Enter == CrLf/Lf */ NSDebugLLog(@"term",@"ignore _set_mode 20"); #if 0 if (on_off) set_kbd(lnm); else clr_kbd(lnm); #endif break; } } #define setterm_command(foo) [self _setterm_command] -(void) _setterm_command { NSDebugLLog(@"term",@"ignore _setterm_command %i\n",par[0]); /* TODO: will need _update_attr */ switch(par[0]) { #if 0 case 1: /* set color for underline mode */ if (can_do_color && par[1] < 16) { ulcolor = color_table[par[1]]; if (underline) update_attr(currcons); } break; case 2: /* set color for half intensity mode */ if (can_do_color && par[1] < 16) { halfcolor = color_table[par[1]]; if (intensity == 0) update_attr(currcons); } break; #endif case 8: /* store colors as defaults */ def_color = color; /* if (hi_font_mask == 0x100) def_color >>= 1;*/ [self _default_attr]; [self _update_attr]; break; #if 0 case 9: /* set blanking interval */ blankinterval = ((par[1] < 60) ? par[1] : 60) * 60 * HZ; poke_blanked_console(); break; case 10: /* set bell frequency in Hz */ if (npar >= 1) bell_pitch = par[1]; else bell_pitch = DEFAULT_BELL_PITCH; break; case 11: /* set bell duration in msec */ if (npar >= 1) bell_duration = (par[1] < 2000) ? par[1]*HZ/1000 : 0; else bell_duration = DEFAULT_BELL_DURATION; break; case 12: /* bring specified console to the front */ if (par[1] >= 1 && vc_cons_allocated(par[1]-1)) set_console(par[1] - 1); break; case 13: /* unblank the screen */ poke_blanked_console(); break; case 14: /* set vesa powerdown interval */ vesa_off_interval = ((par[1] < 60) ? par[1] : 60) * 60 * HZ; break; #endif } } -(void) processByte: (unsigned char)c { #define lf() do { \ if (y+1==bottom) \ { \ scrup(foo,top,bottom,1,(top==0 && bottom==height)?YES:NO); \ } \ else if (y0) \ { \ y--; \ [ts ts_goto: x:y]; \ } \ } while (0) #define cr() do { x=0; [ts ts_goto: x:y]; } while (0) #define cursor_report(foo,bar) do { \ char buf[40]; \ \ sprintf(buf, "\033[%d;%dR", y + (decom ? top+1 : 1), x+1); \ [ts ts_sendCString: buf]; \ } while (0) #define status_report(foo) do { \ [ts ts_sendCString: "\033[0n"]; \ } while (0) #define VT102ID "\033[?6c" #define respond_ID(foo) do { [ts ts_sendCString: VT102ID]; } while (0) switch (c) { case 0: return; case 7: if (vc_state==EStitle_buf) { NSString *new_title; title_buf[title_len]=0; new_title=[NSString stringWithCString: title_buf]; [ts ts_setTitle: new_title type: title_type]; vc_state=ESnormal; return; } NSBeep(); return; case 8: if (x>0) { x--; [ts ts_goto: x:y]; } return; case 9: while (x < width - 1) { x++; if (tab_stop[x >> 5] & (1 << (x & 31))) break; } [ts ts_goto: x:y]; return; case 10: case 11: case 12: lf(); /* if (!is_kbd(lnm))*/ return; case 13: cr(); return; case 14: charset = 1; translate = set_translate(G1_charset,currcons); disp_ctrl = 1; return; case 15: charset = 0; translate = set_translate(G0_charset,currcons); disp_ctrl = 0; return; case 24: case 26: vc_state = ESnormal; return; case 27: vc_state = ESesc; return; case 127: // del(currcons); return; case 128+27: // This kills UTF-8 unless we do some funky stuff if (!utf_count) { vc_state = ESsquare; return; } } switch(vc_state) { case ESesc: vc_state = ESnormal; switch (c) { case '[': vc_state = ESsquare; return; case ']': vc_state = ESnonstd; return; case '%': vc_state = ESpercent; return; case 'E': cr(); lf(); return; case 'M': ri(); return; case 'D': lf(); return; case 'H': tab_stop[x >> 5] |= (1 << (x & 31)); return; case 'Z': respond_ID(foo); return; case '7': save_cur(currcons); return; case '8': restore_cur(currcons); return; case '(': vc_state = ESsetG0; return; case ')': vc_state = ESsetG1; return; case '#': vc_state = EShash; return; case 'c': [self _reset_terminal]; return; case '>': /* Numeric keypad */ NSDebugLLog(@"term",@"ignore ESesc > keypad"); #if 0 clr_kbd(kbdapplic); #endif return; case '=': /* Appl. keypad */ NSDebugLLog(@"term",@"ignore ESesc = keypad"); #if 0 set_kbd(kbdapplic); #endif return; } return; case ESnonstd: switch (c) { case '0': case '1': case '2': vc_state=EStitle_semi; title_type=c-'0'; return; case 'P': NSDebugLLog(@"term",@"ignore ESnonstd P"); #if 0 for (npar=0; npar='0'&&c<='9') || (c>='A'&&c<='F') || (c>='a'&&c<='f') ) { par[npar++] = (c>'9' ? (c&0xDF)-'A'+10 : c-'0') ; if (npar==7) { int i = par[0]*3, j = 1; palette[i] = 16*par[j++]; palette[i++] += par[j++]; palette[i] = 16*par[j++]; palette[i++] += par[j++]; palette[i] = 16*par[j++]; palette[i] += par[j]; set_palette(currcons); vc_state = ESnormal; } } else #endif vc_state = ESnormal; return; case ESsquare: for(npar = 0 ; npar < NPAR ; npar++) par[npar] = 0; npar = 0; vc_state = ESgetpars; if (c == '[') { /* Function key */ vc_state=ESfunckey; return; } ques = (c=='?'); if (ques) return; case ESgetpars: if (c==';' && npar='0' && c<='9') { par[npar] *= 10; par[npar] += c-'0'; return; } else vc_state=ESgotpars; case ESgotpars: vc_state = ESnormal; switch(c) { case 'h': set_mode(currcons,1); return; case 'l': set_mode(currcons,0); return; case 'c': NSDebugLLog(@"term",@"ignore ESgotpars c"); #if 0 if (ques) { if (par[0]) cursor_type = par[0] | (par[1]<<8) | (par[2]<<16); else cursor_type = CUR_DEFAULT; return; } #endif break; case 'n': if (!ques) { if (par[0] == 5) status_report(tty); else if (par[0] == 6) cursor_report(currcons,tty); } return; } if (ques) { ques = 0; return; } switch(c) { case 'G': case '`': if (par[0]) par[0]--; gotoxy(currcons,par[0],y); return; case 'A': if (!par[0]) par[0]++; gotoxy(currcons,x,y-par[0]); return; case 'B': case 'e': if (!par[0]) par[0]++; gotoxy(currcons,x,y+par[0]); return; case 'C': case 'a': if (!par[0]) par[0]++; gotoxy(currcons,x+par[0],y); return; case 'D': if (!par[0]) par[0]++; gotoxy(currcons,x-par[0],y); return; case 'E': if (!par[0]) par[0]++; gotoxy(currcons,0,y+par[0]); return; case 'F': if (!par[0]) par[0]++; gotoxy(currcons,0,y-par[0]); return; case 'd': if (par[0]) par[0]--; gotoxay(currcons,x,par[0]); return; case 'H': case 'f': if (par[0]) par[0]--; if (par[1]) par[1]--; gotoxay(currcons,par[1],par[0]); return; case 'J': csi_J(currcons,par[0]); return; case 'K': csi_K(currcons,par[0]); return; case 'L': csi_L(currcons,par[0]); return; case 'M': csi_M(currcons,par[0]); return; case 'P': csi_P(currcons,par[0]); return; case 'c': if (!par[0]) respond_ID(tty); return; case 'g': if (!par[0]) tab_stop[x >> 5] &= ~(1 << (x & 31)); else if (par[0] == 3) { tab_stop[0] = tab_stop[1] = tab_stop[2] = tab_stop[3] = tab_stop[4] = 0; } return; case 'm': csi_m(currcons); return; case 'q': /* DECLL - but only 3 leds */ /* map 0,1,2,3 to 0,1,2,4 */ NSDebugLLog(@"term",@"ignore ESgotpars q"); #if 0 if (par[0] < 4) setledstate(kbd_table + currcons, (par[0] < 3) ? par[0] : 4); #endif return; case 'r': if (!par[0]) par[0]++; if (!par[1]) par[1] = height; /* Minimum allowed region is 2 lines */ if (par[0] < par[1] && par[1] <= height) { top=par[0]-1; bottom=par[1]; gotoxay(currcons,0,0); } return; case 's': save_cur(currcons); return; case 'u': restore_cur(currcons); return; case 'X': csi_X(currcons, par[0]); return; case '@': csi_at(currcons,par[0]); return; case ']': /* setterm functions */ setterm_command(currcons); return; } return; case ESpercent: vc_state = ESnormal; switch (c) { case '@': /* defined in ISO 2022 */ utf = 0; return; case 'G': /* prelim official escape code */ case '8': /* retained for compatibility */ utf = 1; return; } return; case ESfunckey: vc_state = ESnormal; return; case EShash: vc_state = ESnormal; NSDebugLLog(@"term",@"ignore EShash"); #if 0 if (c == '8') { /* DEC screen alignment test. kludge :-) */ video_erase_char = (video_erase_char & 0xff00) | 'E'; csi_J(currcons, 2); video_erase_char = (video_erase_char & 0xff00) | ' '; do_update_region(currcons, origin, screenbuf_size/2); } #endif return; case ESsetG0: if (c == '0') G0_charset = GRAF_MAP; else if (c == 'B') G0_charset = LAT1_MAP; else if (c == 'U') G0_charset = IBMPC_MAP; else if (c == 'K') G0_charset = USER_MAP; if (charset == 0) translate = set_translate(G0_charset,currcons); vc_state = ESnormal; return; case ESsetG1: if (c == '0') G1_charset = GRAF_MAP; else if (c == 'B') G1_charset = LAT1_MAP; else if (c == 'U') G1_charset = IBMPC_MAP; else if (c == 'K') G1_charset = USER_MAP; if (charset == 1) translate = set_translate(G1_charset,currcons); vc_state = ESnormal; return; default: vc_state = ESnormal; if (utf && c>0x7f) { if (utf_count && (c&0xc0)==0x80) { unich=(unich<<6)|(c&0x3f); utf_count--; if (utf_count) return; } else { if ((c & 0xe0) == 0xc0) { utf_count = 1; unich = (c & 0x1f); } else if ((c & 0xf0) == 0xe0) { utf_count = 2; unich = (c & 0x0f); } else if ((c & 0xf8) == 0xf0) { utf_count = 3; unich = (c & 0x07); } else if ((c & 0xfc) == 0xf8) { utf_count = 4; unich = (c & 0x03); } else if ((c & 0xfe) == 0xfc) { utf_count = 5; unich = (c & 0x01); } else utf_count = 0; return; } } else if (!iconv_state || translate!=translate_maps[0]) { if (toggle_meta) c|=0x80; unich=translate[c]; } else #define PUTCH \ if (x>=width && decawm) \ { \ cr(); \ lf(); \ } \ char_width=[ts relativeWidthOfCharacter: ch.ch]; \ if (decim) \ [ts ts_shiftRow: y at: x delta: char_width]; \ [ts ts_putChar: ch count: 1 at: x:y]; \ if (xwidth) \ char_width=width-x; \ if (char_width>0) \ { \ ch.ch=MULTI_CELL_GLYPH; \ [ts ts_putChar: ch count: char_width at: x:y]; \ x+=char_width; \ } \ [ts ts_goto: x:y]; \ } { screen_char_t ch; char *inp; size_t in_size; char *outp; size_t out_size; int char_width; int ret; if (toggle_meta) c|=0x80; /* TODO: there might be other cases where we should clear the buffer */ if (input_buf_len==sizeof(input_buf)) { NSLog(@"Warning: iconv() input buffer overrun!"); input_buf_len=0; } input_buf[input_buf_len++]=c; ch.color=color; ch.attr=(intensity)|(underline<<2)|(reverse<<3)|(blink<<4); inp=(char *)input_buf; in_size=input_buf_len; do { outp=(char *)&unich; out_size=4; utf_count=0; // reset the non-internal utf count ret=iconv(iconv_state,(char **)&inp,&in_size,&outp,&out_size); if (out_size==0) { ch.ch=ntohl(unich); PUTCH } if (ret>=0) break; if (errno==EILSEQ) { /* illegal input sequence. skip one byte and try again. */ ch.ch=0xfffd; PUTCH in_size--; inp++; } if (errno==EINVAL) { /* incomplete input sequence. wait for more input. */ utf_count=1; // FIXME: is this the right thing to do? break; } /* keep going while there's more input and the error was lack of output space */ } while (in_size>0 && errno==E2BIG); /* adjust the buffer */ if (in_size!=input_buf_len) { if (in_size) memmove(input_buf,inp,in_size); input_buf_len=in_size; } return; } { screen_char_t ch; int char_width; ch.color=color; ch.attr=(intensity)|(underline<<2)|(reverse<<3)|(blink<<4); ch.ch=unich; PUTCH } return; #undef PUTCH } } /* Translates '\n' to '\r' when sending. */ -(void) sendString: (NSString *)s { int l=[s length]; unsigned int ucs; int i; if (iconv_input_state) { unsigned int *inp; size_t insize; char *outp; char buf[16+1]; size_t outsize; for (i=0;i1) { s=[e characters]; NSDebugLLog(@"key",@" writing '%@'\n",s); [self sendString: s]; return; } ch=[s characterAtIndex: 0]; str=NULL; nstr=nil; ch2=0; switch (ch) { case '\e': if ([TerminalViewKeyboardPrefs doubleEscape]) str="\e\e"; else str="\e"; break; case NSUpArrowFunctionKey : str="\e[A"; break; case NSDownArrowFunctionKey : str="\e[B"; break; case NSLeftArrowFunctionKey : str="\e[D"; break; case NSRightArrowFunctionKey: str="\e[C"; break; case NSF1FunctionKey : str="\e[[A"; break; case NSF2FunctionKey : str="\e[[B"; break; case NSF3FunctionKey : str="\e[[C"; break; case NSF4FunctionKey : str="\e[[D"; break; case NSF5FunctionKey : str="\e[[E"; break; case NSF6FunctionKey : str="\e[17~"; break; case NSF7FunctionKey : str="\e[18~"; break; case NSF8FunctionKey : str="\e[19~"; break; case NSF9FunctionKey : str="\e[20~"; break; case NSF10FunctionKey: str="\e[21~"; break; case NSF11FunctionKey: str="\e[23~"; break; case NSF12FunctionKey: str="\e[24~"; break; case NSF13FunctionKey: str="\e[25~"; break; case NSF14FunctionKey: str="\e[26~"; break; case NSF15FunctionKey: str="\e[28~"; break; case NSF16FunctionKey: str="\e[29~"; break; case NSF17FunctionKey: str="\e[31~"; break; case NSF18FunctionKey: str="\e[32~"; break; case NSF19FunctionKey: str="\e[33~"; break; case NSF20FunctionKey: str="\e[34~"; break; case NSHomeFunctionKey : str="\e[1~"; break; case NSInsertFunctionKey : str="\e[2~"; break; case NSDeleteFunctionKey : str="\e[3~"; break; case NSEndFunctionKey : str="\e[4~"; break; case NSPageUpFunctionKey : str="\e[5~"; break; case NSPageDownFunctionKey: str="\e[6~"; break; case 9: // tab if (mask&NSShiftKeyMask) str="\e[Z"; else nstr=[e characters]; break; case 8: ch2=0x7f; break; case 3: ch2=0x0d; break; default: nstr=[e characters]; break; } { BOOL commandAsMeta=[TerminalViewKeyboardPrefs commandAsMeta]; BOOL altIsNotMeta =[TerminalViewKeyboardPrefs altIsNotMeta]; /* Thanks to different keyboard layouts and dumb default key handling in GNUstep, this is a bit complex. There seem to be two main cases: a. GNUstep has been correctly configured. Command is really command, alternate is really alternate, and is used as meta. AltGr isn't anything at all. No special options necessary. b. GNUstep is using the default settings. Left alt is command, right alt (which might be AltGr) is alternate. Users seem to actually want left alt to be meta, and, if right alt is AltGr, right alt not to be meta. Thus, when command-as-meta option is active, we intercept command presses and treat them as meta, and we ignore alternate. altIsNotMeta is needed to keep Alt as Alt and not as Meta. */ if ((commandAsMeta && (mask&NSCommandKeyMask)) || (!commandAsMeta && !altIsNotMeta && (mask&NSAlternateKeyMask))) { NSDebugLLog(@"key",@" meta"); [ts ts_sendCString: "\e"]; } } if (nstr) { NSDebugLLog(@"key",@" send NSString '%@'",nstr); [self sendString: nstr]; } else if (str) { NSDebugLLog(@"key",@" send '%s'",str); [ts ts_sendCString: str]; } else if (ch2>256) { NSDebugLLog(@"key",@" couldn't send %04x",ch2); NSBeep(); } else if (ch2>0) { unsigned char tmp; tmp=ch2; NSDebugLLog(@"key",@" send %02x",ch2); [ts ts_sendCString: (char *)&tmp length: 1]; } } - initWithTerminalScreen: (id)ats width: (int)w height: (int)h { const char *iconv_charset; if (!(self=[super init])) return nil; ts=ats; width=w; height=h; color=def_color=0x07; [self _reset_terminal]; iconv_charset=[TerminalParser_LinuxPrefs characterSet]; if (strcmp(iconv_charset,"iso-8859-1")) { iconv_state=iconv_open("ucs-4",iconv_charset); if (iconv_state==(iconv_t)-1) { iconv_state=NULL; NSLog(@"Warning: unable to create iconv handle for conversion from '%s'!", iconv_charset); NSLog(@"Falling back to iso-8859-1 (latin1)."); } iconv_input_state=iconv_open(iconv_charset,"ucs-4"); if (iconv_input_state==(iconv_t)-1) { iconv_input_state=NULL; NSLog(@"Warning: unable to create iconv handle for conversion to '%s'!", iconv_charset); NSLog(@"Falling back to iso-8859-1 (latin1)."); } } return self; } -(void) dealloc { if (iconv_state) iconv_close(iconv_state); if (iconv_input_state) iconv_close(iconv_input_state); [super dealloc]; } -(void) setTerminalScreenWidth: (int)w height: (int)h { y+=h-height; width=w; height=h; top=0; bottom=height; if (x>=width) x=width-1; if (x<0) x=0; if (y>=height) y=height-1; if (y<0) y=0; } @end Terminal-0.9.8/French.lproj/0000755000175000001440000000000011667362252015110 5ustar multixusersTerminal-0.9.8/French.lproj/Localizable.strings0000644000175000001440000002070011016341203020720 0ustar multixusers/* French translation by fabien */ /*** French.lproj/Localizable.strings updated by make_strings 2002-12-09 18:39:09 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:653 */ "Command line:" = "Ligne de commande:"; /* File: TerminalWindow.m:188 */ /* Flag: untranslated */ /* File: TerminalWindow.m:192 */ /* Flag: untranslated */ " (idle)" = " (idle)"; /*** Unmatched/untranslated keys ***/ /* File: PreferencesWindowController.m:70 */ /* Flag: untranslated */ "Revert" = "Revert"; /* File: ServicesPrefs.m:558 */ /* Flag: untranslated */ "No input" = "No input"; /* File: ServicesPrefs.m:559 */ /* Flag: untranslated */ "Input in stdin" = "Input in stdin"; /* File: ServicesPrefs.m:602 */ /* Flag: untranslated */ "Plain text" = "Plain text"; /* File: TerminalParser_LinuxPrefs.m:40 */ /* Flag: untranslated */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:41 */ /* Flag: untranslated */ "West Europe, latin1" = "West Europe, latin1"; /* File: TerminalParser_LinuxPrefs.m:42 */ /* Flag: untranslated */ "East Europe, latin2" = "East Europe, latin2"; /* File: TerminalParser_LinuxPrefs.m:43 */ /* Flag: untranslated */ "Chinese" = "Chinese"; /* File: TerminalParser_LinuxPrefs.m:44 */ /* Flag: untranslated */ "Custom, leave unchanged" = "Custom, leave unchanged"; /* File: TerminalParser_LinuxPrefs.m:103 */ /* Flag: untranslated */ "'linux' terminal parser" = "'linux' terminal parser"; /* File: TerminalParser_LinuxPrefs.m:108 */ /* Flag: untranslated */ "'linux'\nparser" = "'linux'\nparser"; /* File: TerminalParser_LinuxPrefs.m:151 */ /* Flag: untranslated */ "Character set:" = "Character set:"; /* File: TerminalViewPrefs.m:255 */ /* Flag: untranslated */ "Scroll-back length in lines:" = "Scroll-back length in lines:"; /* File: TerminalViewPrefs.m:282 */ /* Flag: untranslated */ "Style:" = "Style:"; /* File: TerminalViewPrefs.m:290 */ /* Flag: untranslated */ "Stroked block" = "Stroked block"; /* File: TerminalViewPrefs.m:291 */ /* Flag: untranslated */ "Filled block" = "Filled block"; /* File: TerminalViewPrefs.m:292 */ /* Flag: untranslated */ "Inverted block" = "Inverted block"; /* File: TerminalViewPrefs.m:319 */ /* Flag: untranslated */ "Handle wide (multi-cell) glyphs" = "Handle wide (multi-cell) glyphs"; /* File: TerminalViewPrefs.m:527 */ /* Flag: untranslated */ "Shell:" = "Shell:"; /* File: TerminalViewPrefs.m:651 */ /* Flag: untranslated */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta."; /* File: main.m:157 */ /* Flag: untranslated */ "Benchmark" = "Benchmark"; /* File: main.m:171 */ /* Flag: untranslated */ "New terminal" = "New terminal"; /* File: main.m:199 */ /* Flag: untranslated */ "Services" = "Services"; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:78 */ "Apply and save" = "Appliquer et sauvegarder"; /* File: PreferencesWindowController.m:122 */ "Preferences" = "Panneau des Pr\u00e9f\u00e9rences"; /*** Strings from Services.m ***/ /* File: Services.m:152 */ "Service aborted by user." = "Service annul\u00e9e par l'utilisateur."; /* File: Services.m:60 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "Il n'y a aucun service de terminal appel\u00e9e '%@'.\nVotre liste de services n'est probabement pas \u00e0 jout.\nLancer 'make_services' pour la mettre \u00e0 jour."; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Annuler"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /* File: ServicesParameterWindowController.m:118 */ "Parameter for service %@" = "Param\u00e8tre pour le service %@"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:585 */ "Accept types" = "Accepte les types"; /* File: ServicesPrefs.m:499 */ "Add" = "Ajouter"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "erreur durant l'import services"; /* File: ServicesPrefs.m:401 */ "Export services" = "Exporter les services"; /* File: ServicesPrefs.m:523 */ "Export..." = "Exporter..."; /* File: ServicesPrefs.m:594 */ "Filenames" = "Noms de fichiers"; /* File: ServicesPrefs.m:549 */ "Ignore output" = "Ignorer la sortie"; /* File: ServicesPrefs.m:254 */ "Import services" = "Importer des services"; /* File: ServicesPrefs.m:515 */ "Import..." = "Importer..."; /* File: ServicesPrefs.m:560 */ "Input on command line" = "Entr\u00e9e standard sur la ligne de commande"; /* File: ServicesPrefs.m:640 */ "Key:" = "Touche:"; /* File: ServicesPrefs.m:627 */ "Name:" = "Nom:"; /* File: ServicesPrefs.m:507 */ "Remove" = "Supprimer"; /* File: ServicesPrefs.m:550 */ "Return output" = "Retourer la sortie standard"; /* File: ServicesPrefs.m:568 */ "Run in background" = "Ex\u00e9cuter en arri\u00e8re plan"; /* File: ServicesPrefs.m:570 */ "Run in idle window" = "Ex\u00e9cuter en idle fen\u00eatre"; /* File: ServicesPrefs.m:569 */ "Run in new window" = "Ex\u00e9cuter dans une nouvell fen\u00eatre"; /* File: ServicesPrefs.m:468 */ "Terminal services" = "services de Terminal"; /* File: ServicesPrefs.m:473 */ "Terminal\nservices" = "Services de \nTerminal"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "Le fichier '%@' contient des services qui ne sont pas valide."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "service Inconnu"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1623 */ "Unable to fork: %m." = "Impossible de cr\u00e9er forker: %m."; /* File: TerminalView.m:1611 */ "Unable to open pipe for input: %m." = "Impossible d'ouvrire un pipe pour l'entr\u00e9e standard: %m."; /* File: TerminalView.m:1476 */ "[Process exited]" = "[Fin de processus]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:330 */ "Bold font:" = "Texte gras:"; /* File: TerminalViewPrefs.m:298 */ "Color:" = "Couleur:"; /* File: TerminalViewPrefs.m:277 */ "Cursor" = "Curseur"; /* File: TerminalViewPrefs.m:225 */ /* File: TerminalViewPrefs.m:230 */ "Display" = "Affichage"; /* File: TerminalViewPrefs.m:607 */ /* File: TerminalViewPrefs.m:602 */ "Keyboard" = "Clavier"; /* File: TerminalViewPrefs.m:289 */ "Line" = "Ligne"; /* File: TerminalViewPrefs.m:357 */ "Normal font:" = "Texte normal:"; /* File: TerminalViewPrefs.m:369 */ /* File: TerminalViewPrefs.m:342 */ "Pick font..." = "D\u00e9finir la police..."; /* File: TerminalViewPrefs.m:492 */ /* File: TerminalViewPrefs.m:487 */ "Shell" = "Shell par d\u00e9faut"; /* File: TerminalViewPrefs.m:515 */ "Start as login-shell" = "D\u00e9marrer comme login-shell"; /* File: TerminalViewPrefs.m:634 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Traiter la touche command comme meta.\n\nNotez qu'avec cette touche activ\u00e9e,vous\nn'aurez plus acc\u00e9s au menu."; /*** Strings from TerminalWindowPrefs.m ***/ /* File: TerminalWindowPrefs.m:192 */ "Add top and bottom border" = "Ajouter une bordure en haut et en bas"; /* File: TerminalWindowPrefs.m:143 */ "Close new windows when idle" = "Fermer les nouvelles fen\u00eatre lorsque lorsque le shell se termine"; /* File: TerminalWindowPrefs.m:156 */ "Default size" = "Taille par d\u00e9faut"; /* File: TerminalWindowPrefs.m:144 */ "Don't close new windows" = "Ne pas fermer les nouvelles fen\u00eatre"; /* File: TerminalWindowPrefs.m:169 */ "Height:" = "Hauteur:"; /* File: TerminalWindowPrefs.m:112 */ "Terminal Window" = "Fen\u00eatre Terminal"; /* File: TerminalWindowPrefs.m:117 */ "Terminal\nWindow" = "Fen\u00eatre\nTerminal"; /* File: TerminalWindowPrefs.m:160 */ "Width:" = "Largeur:"; /*** Strings from main.m ***/ /* File: main.m:191 */ "Close" = "Fermer"; /* File: main.m:180 */ "Copy" = "Copier"; /* File: main.m:177 */ "Cut" = "Couper"; /* File: main.m:186 */ "Edit" = "Editer"; /* File: main.m:203 */ "Hide" = "Masquer"; /* File: main.m:159 */ "Info" = "Information"; /* File: main.m:153 */ "Info..." = "Panneaux d'informations"; /* File: main.m:183 */ "Paste" = "Coller"; /* File: main.m:155 */ "Preferences..." = "Pr\u00e9f\u00e9rences..."; /* File: main.m:207 */ "Quit" = "Quitter"; /* File: main.m:194 */ "Windows" = "Fen\u00eatres"; Terminal-0.9.8/cursor_line.tiff0000644000175000001440000000262411561216225015747 0ustar multixusersMM*Ð Ð þÌÈ(ÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ08H08H08H08H08H08H08H Àø Àø Àø Àø Àø Àø ÀøTerminal-0.9.8/ChangeLog0000644000175000001440000000726111725512651014331 0ustar multixusers2012-04-03 Riccardo Mottola * TerminalView.m Fix GNU/HURD includes. 2012-03-28 Sebastian Reitenbach * TerminalView.m Fix warnings on 64Bit systems, cast from integer to pointer of different size 2012-03-27 Riccardo Mottola * TerminalView.m Fix OpenBSD includes. 2012-03-26 Riccardo Mottola * PreferencesWindowController.m Use NSUInteger as Index. 2012-03-26 Riccardo Mottola * PreferencesWindowController.[h,m] Clean up imports 2012-03-07 Riccardo Mottola * GNUmakefile: Use TOOL_LIBS instead of LDFLAGS to link the framework library. 2011-12-04 Riccardo Mottola * TerminalParser_Linux.m * TerminalViewPrefs.h * TerminalViewPrefs.m Add Alt is not Meta option, to enable the usage of AltGr, when left Alt is command. 2011-05-07 Riccardo Mottola * Terminal.tiff * cursor_filled.tiff * cursor_inverted.tiff * cursor_line.tiff * cursor_stroked.tiff Set resolution to 72 dpi screen. 2010-12-14 Riccardo Mottola * main.m: hide ordered out quit panel from windows menu 2010-05-14 04:37-EDT Gregory John Casamento * TerminalView.m: Correct sign issues with some pointer casts. 2010-05-14 Riccardo Mottola * ServicesPrefs.m: Added missing import * TerminalView.m: initialize to avoid warnings. 2010-03-26 Riccardo Mottola * ServicesPrefs.m, TerminalParser_Linux.m, TerminalParser_LinuxPrefs.m, TerminalViewPrefs.m: updated imports 2010-01-16 Riccardo Mottola * Italian.lproj/Localizable.strings, GNUMakefile: added italian translation, revised version of the draft provided by Guido Agostini 2009-12-24 Riccardo Mottola * PreferencesWindowController.m : correct invocation signature 2009-10-24 Riccardo Mottola * PreferencesWindowController.m : simplify methodSignatureForSelector according to David Chisnall 2009-10-20 Riccardo Mottola * main.m : regenerate services plist on startup * TerminalViewPrefs.m : remove hack about return type no longer needed 2009-08-05 Richard Frith-Macdonald * TerminalView.h * TerminalView.m * TerminalViewPrefs.h * TerminalViewPrefs.m Implementd Black on White text and its preference setting. 2009-05-27 Riccardo Mottola * TerminalParser_Linux.m: imported a patch by Jeff Teunissen, Backbone: Terminal interpreted certain UTF-8 code sequences wrong, like e2 95 9b (U+255B, which the bug transforms into e2 95 94). It turns out that it's due to the Linux console emulation, which interprets the 0x9b character (CSI, which is ESC with the high order bit set) to begin a control command. Change the terminal emulation to only switch into command scanning mode if we aren't in the middle of a multi-byte character (that is, if iconv says it's not done processing the current character 0x9b is just a byte to be consumed). This is the only 8-bit character that the console treats specially, so this should be a complete fix. 2009-05-15 17:35-EDT Gregory John Casamento * GNUmakefile: Added plist to makefile. * TerminalInfo.plist: Updated information in plist. 2009-01-02 Riccardo Mottola * TerminalView.m: OpenBSD portability 2009-01-01 Riccardo Mottola * TerminalView.m: ForkPty and OpenPty replacements 2008-07-12 Riccardo Mottola * TerminalView.m: Remove font metric hack for xlib and art backend (after fixes in backend, requires backend date 12 July 2008). Patch by Fred Kiefer Terminal-0.9.8/PrefBox.h0000644000175000001440000000221011016341203014244 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef PrefBox_h #define PrefBox_h @class NSView,NSButton,NSString; @protocol PrefBox -(void) setupButton: (NSButton *)b; /* Called when the PrefBox is added to a preferences panel. It should add a label or an image or something to the button. */ -(void) willHide; /* Called just before another PrefBox will be displayed if this one is currently displayed.*/ -(NSView *) willShow; /* Called before this PrefBox will be displayed. Should return the top-level NSView that should be displayed. (This view should probably be cached, but creating it on demand is nice.) */ -(void) save; -(void) revert; /* Called on all PrefBox:s when the user clicks the save or revert button. */ -(NSString *) name; /* Return the name that is displayed in the header of the NSBox when this PrefBox is displayed. */ @end #endif Terminal-0.9.8/main.m0000644000175000001440000002757711501764776013706 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg 2009-2010 GAP Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import /* For the quit panel: */ #import #import #import #import #import #import #import #import #import "Label.h" #import "PreferencesWindowController.h" #import "Services.h" #import "ServicesPrefs.h" #import "TerminalView.h" #import "TerminalViewPrefs.h" #import "TerminalWindow.h" #import "TerminalWindowPrefs.h" #import "TerminalParser_LinuxPrefs.h" @interface NSMenu (helpers) -(id ) addItemWithTitle: (NSString *)s; -(id ) addItemWithTitle: (NSString *)s action: (SEL)sel; @end @implementation NSMenu (im_lazy) -(id ) addItemWithTitle: (NSString *)s { return [self addItemWithTitle: s action: NULL keyEquivalent: nil]; } -(id ) addItemWithTitle: (NSString *)s action: (SEL)sel { return [self addItemWithTitle: s action: sel keyEquivalent: nil]; } @end @interface Terminal : NSObject { PreferencesWindowController *pwc; NSPanel *quitPanel; BOOL quitPanelOpen; } @end @implementation Terminal - init { if (!(self=[super init])) return nil; return self; } -(void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; DESTROY(pwc); [super dealloc]; } -(void) openPreferences: (id)sender { if (!pwc) { NSObject *pb; pwc=[[PreferencesWindowController alloc] init]; pb=[[TerminalViewDisplayPrefs alloc] init]; [pwc addPrefBox: pb]; DESTROY(pb); pb=[[TerminalViewShellPrefs alloc] init]; [pwc addPrefBox: pb]; DESTROY(pb); pb=[[TerminalViewKeyboardPrefs alloc] init]; [pwc addPrefBox: pb]; DESTROY(pb); pb=[[TerminalWindowPrefs alloc] init]; [pwc addPrefBox: pb]; DESTROY(pb); pb=[[TerminalServicesPrefs alloc] init]; [pwc addPrefBox: pb]; DESTROY(pb); pb=[[TerminalParser_LinuxPrefs alloc] init]; [pwc addPrefBox: pb]; DESTROY(pb); } [pwc showWindow: self]; } -(void) applicationWillTerminate: (NSNotification *)n { } -(void) applicationWillFinishLaunching: (NSNotification *)n { NSMenu *menu,*m/*,*m2*/; [TerminalView registerPasteboardTypes]; menu=[[NSMenu alloc] init]; /* 'Info' menu */ m=[[NSMenu alloc] init]; [m addItemWithTitle: _(@"Info...") action: @selector(orderFrontStandardInfoPanel:)]; [m addItemWithTitle: _(@"Preferences...") action: @selector(openPreferences:)]; [m addItemWithTitle: _(@"Benchmark") action: @selector(benchmark:)]; [menu setSubmenu: m forItem: [menu addItemWithTitle: _(@"Info")]]; [m release]; /* 'Terminal' menu */ /* TODO: think hard about this. originally, the Terminal menu was supposed to have several entries. */ /* m=[[NSMenu alloc] init]; [m addItemWithTitle: _(@"New window") action: @selector(openWindow:) keyEquivalent: @"n"]; [menu setSubmenu: m forItem: [menu addItemWithTitle: _(@"Terminal")]]; [m release];*/ [menu addItemWithTitle: _(@"New terminal") action: @selector(openWindow:) keyEquivalent: @"n"]; /* 'Edit' menu */ m=[[NSMenu alloc] init]; [m addItemWithTitle: _(@"Cut") action: @selector(cut:) keyEquivalent: @"x"]; [m addItemWithTitle: _(@"Copy") action: @selector(copy:) keyEquivalent: @"c"]; [m addItemWithTitle: _(@"Paste") action: @selector(paste:) keyEquivalent: @"v"]; [menu setSubmenu: m forItem: [menu addItemWithTitle: _(@"Edit")]]; [m release]; /* 'Windows' menu */ m=[[NSMenu alloc] init]; [m addItemWithTitle: _(@"Close") action: @selector(performClose:) keyEquivalent: @"w"]; [m addItemWithTitle: _(@"Miniaturize all") action: @selector(miniaturizeAll:) keyEquivalent: @"m"]; [menu setSubmenu: m forItem: [menu addItemWithTitle: _(@"Windows")]]; [NSApp setWindowsMenu: m]; [m release]; m=[[NSMenu alloc] init]; [menu setSubmenu: m forItem: [menu addItemWithTitle: _(@"Services")]]; [NSApp setServicesMenu: m]; [m release]; [menu addItemWithTitle: _(@"Hide") action: @selector(hide:) keyEquivalent: @"h"]; [menu addItemWithTitle: _(@"Quit") action: @selector(terminate:) keyEquivalent: @"q"]; [NSApp setMainMenu: menu]; [menu release]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(noMoreActiveWindows:) name: TerminalWindowNoMoreActiveWindowsNotification object: nil]; } -(void) openWindow: (id)sender { TerminalWindowController *twc; twc=[TerminalWindowController newTerminalWindow]; [[twc terminalView] runShell]; } -(void) applicationDidFinishLaunching: (NSNotification *)n { NSArray *args=[[NSProcessInfo processInfo] arguments]; [TerminalServices updateServicesPlist]; [NSApp setServicesProvider: [[TerminalServices alloc] init]]; if ([args count]>1) { TerminalWindowController *twc; NSString *cmdline; args=[args subarrayWithRange: NSMakeRange(1,[args count]-1)]; cmdline=[args componentsJoinedByString: @" "]; twc=[TerminalWindowController newTerminalWindow]; [[twc terminalView] runProgram: @"/bin/sh" withArguments: [NSArray arrayWithObjects: @"-c",cmdline,nil] initialInput: nil]; } else [self openWindow: self]; } -(NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *)sender { if (![TerminalWindowController numberOfActiveWindows]) return NSTerminateNow; if (!quitPanel) { NSButton *b_quit,*b_dont; { GSVbox *vb=[[GSVbox alloc] init]; [vb setBorder: 10.0]; { NSButton *butt; GSHbox *hb; hb=[[GSHbox alloc] init]; [hb setAutoresizingMask: NSViewMinXMargin]; butt=b_quit=[[NSButton alloc] init]; [butt setTitle: _(@"Quit anyway")]; [butt setTarget: self]; [butt setAction: @selector(quitAnyway:)]; [butt sizeToFit]; [hb addView: butt enablingXResizing: NO]; DESTROY(butt); butt=b_dont=[[NSButton alloc] init]; [butt setTitle: _(@"Don't quit")]; [butt setImagePosition: NSImageRight]; [butt setImage: [NSImage imageNamed: @"common_ret"]]; [butt setTarget: self]; [butt setAction: @selector(dontQuit:)]; [butt sizeToFit]; [hb addView: butt enablingXResizing: NO withMinXMargin: 8.0]; DESTROY(butt); [vb addView: hb enablingYResizing: NO]; DESTROY(hb); } { NSTextField *text; text=[NSTextField newLabel: _(@"There are active windows. Quitting will close them.")]; [text setAutoresizingMask: NSViewWidthSizable|NSViewMinYMargin]; [text sizeToFit]; [vb addView: text enablingYResizing: YES withMinYMargin: 8.0]; DESTROY(text); } [vb addSeparatorWithMinYMargin: 8.0]; { NSImageView *iv; NSTextField *title; GSHbox *hb; hb=[[GSHbox alloc] init]; iv=[[NSImageView alloc] init]; [iv setImage: [NSApp applicationIconImage]]; [iv setEditable: NO]; [iv sizeToFit]; [hb addView: iv enablingXResizing: NO]; DESTROY(iv); title=[NSTextField newLabel: _(@"Quit?")]; [title setAutoresizingMask: NSViewMinYMargin|NSViewMaxYMargin]; [title setFont: [NSFont systemFontOfSize: 18.0]]; [title sizeToFit]; [hb addView: title enablingXResizing: NO withMinXMargin: 8.0]; DESTROY(title); [vb addView: hb enablingYResizing: NO withMinYMargin: 8.0]; DESTROY(hb); } [vb sizeToFit]; quitPanel=[[NSPanel alloc] initWithContentRect: [vb frame] styleMask: NSTitledWindowMask backing: NSBackingStoreRetained defer: YES]; [quitPanel setContentView: vb]; DESTROY(vb); } [quitPanel setTitle: _(@"Quit?")]; [quitPanel setOneShot: YES]; [quitPanel setHidesOnDeactivate: NO]; [quitPanel setExcludedFromWindowsMenu: NO]; [quitPanel setInitialFirstResponder: b_dont]; [b_dont setNextKeyView: b_quit]; [b_quit setNextKeyView: b_dont]; } { /* TODO: always using +mainScreen is probably incorrect */ NSRect r=[[NSScreen mainScreen] frame]; NSPoint o; o.x=r.origin.x+r.size.width/2.0-[quitPanel frame].size.width/2.0; o.y=r.origin.y+r.size.height/2.0-[quitPanel frame].size.height/2.0; [quitPanel setFrameOrigin: o]; } [quitPanel setExcludedFromWindowsMenu: NO]; [quitPanel makeKeyAndOrderFront: self]; quitPanelOpen=YES; return NSTerminateLater; } -(void) quitAnyway: (id)sender { [NSApp replyToApplicationShouldTerminate: YES]; } -(void) dontQuit: (id)sender { [NSApp replyToApplicationShouldTerminate: NO]; quitPanelOpen=NO; [quitPanel orderOut: self]; [quitPanel setExcludedFromWindowsMenu: YES]; } -(void) noMoreActiveWindows: (NSNotification *)n { if (quitPanelOpen) [NSApp replyToApplicationShouldTerminate: YES]; } -(BOOL) application: (NSApplication *)sender openFile: (NSString *)filename { TerminalWindowController *twc; NSDebugLLog(@"Application",@"openFile: '%@'",filename); /* TODO: shouldn't ignore other apps */ [NSApp activateIgnoringOtherApps: YES]; twc=[TerminalWindowController newTerminalWindow]; [[twc terminalView] runProgram: filename withArguments: nil initialInput: nil]; return YES; } -(BOOL) terminalRunProgram: (NSString *)path withArguments: (NSArray *)args inDirectory: (NSString *)directory properties: (NSDictionary *)properties { TerminalWindowController *twc; NSDebugLLog(@"Application", @"terminalRunProgram: %@ withArguments: %@ inDirectory: %@ properties: %@", path,args,directory,properties); /* TODO: shouldn't ignore other apps */ [NSApp activateIgnoringOtherApps: YES]; { id o; o=[properties objectForKey: @"CloseOnExit"]; if (o && [o respondsToSelector: @selector(boolValue)] && ![o boolValue]) { twc=[TerminalWindowController idleTerminalWindow]; } else { twc=[TerminalWindowController newTerminalWindow]; } } [[twc terminalView] runProgram: path withArguments: args inDirectory: directory initialInput: nil arg0: nil]; return YES; } -(BOOL) terminalRunCommand: (NSString *)cmdline inDirectory: (NSString *)directory properties: (NSDictionary *)properties { NSDebugLLog(@"Application", @"terminalRunCommand: %@ inDirectory: %@ properties: %@", cmdline,directory,properties); return [self terminalRunProgram: @"/bin/sh" withArguments: [NSArray arrayWithObjects: @"-c",cmdline,nil] inDirectory: directory properties: properties]; } @end /* TODO */ #include #include @interface NSWindow (avoid_warnings) -(void) sendEvent: (NSEvent *)e; @end @interface TerminalApplication : NSApplication @end @implementation TerminalApplication -(void) sendEvent: (NSEvent *)e { if ([e type]==NSKeyDown && [e modifierFlags]&NSCommandKeyMask && [TerminalViewKeyboardPrefs commandAsMeta]) { NSDebugLLog(@"key",@"intercepting key equivalent"); [[e window] sendEvent: e]; return; } [super sendEvent: e]; } @end int main(int argc, char **argv) { Terminal *term; CREATE_AUTORELEASE_POOL(arp); /* [NSObject enableDoubleReleaseCheck: YES];*/ [TerminalApplication sharedApplication]; term = [[Terminal alloc] init]; [NSApp setDelegate: term]; [NSApp run]; [term release]; DESTROY(arp); return 0; } Terminal-0.9.8/Label.m0000644000175000001440000000121211374617465013753 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #import "Label.h" @implementation NSTextField (label) + newLabel: (NSString *)title { NSTextField *f; f=[[self alloc] init]; [f setStringValue: title]; [f setEditable: NO]; [f setDrawsBackground: NO]; [f setBordered: NO]; [f setBezeled: NO]; [f setSelectable: NO]; [f sizeToFit]; return f; } @end Terminal-0.9.8/.#TerminalParser_Linux.m.1.60000644000175000001440000007136711375063605017501 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg 2009-2010 GAP Project This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ /* lots borrowed from linux/drivers/char/console.c, GNU GPL:ed */ /* * linux/drivers/char/console.c * * Copyright (C) 1991, 1992 Linus Torvalds */ #import #import #import #import #include /* TODO */ #import "TerminalViewPrefs.h" #import #import "TerminalParser_Linux.h" #import "TerminalParser_LinuxPrefs.h" #include "charmaps.h" #define set_translate(charset,foo) _set_translate(charset) static const unichar *_set_translate(int charset) { if (charset<0 || charset>=4) return translate_maps[0]; return translate_maps[charset]; } @interface TerminalParser_Linux (private) #define csi_J(foo,vpar) [self _csi_J: vpar] #define csi_K(foo,vpar) [self _csi_K: vpar] #define csi_L(foo,vpar) [self _csi_L: vpar] #define csi_M(foo,vpar) [self _csi_M: vpar] #define csi_P(foo,vpar) [self _csi_P: vpar] #define csi_X(foo,vpar) [self _csi_X: vpar] #define csi_at(foo,vpar) [self _csi_at: vpar] #define csi_m(foo) [self _csi_m] -(void) _csi_J: (int)vpar; -(void) _csi_K: (int)vpar; -(void) _csi_L: (unsigned int)vpar; -(void) _csi_M: (unsigned int)vpar; -(void) _csi_P: (unsigned int)vpar; -(void) _csi_X: (int)vpar; -(void) _csi_at: (unsigned int)vpar; -(void) _csi_m; -(void) _default_attr; -(void) _update_attr; @end #define SCREEN(x,y) ((x)+(y)*width) @implementation TerminalParser_Linux #define gotoxy(foo,new_x,new_y) do { \ int min_y, max_y; \ \ if (new_x < 0) \ x = 0; \ else \ if (new_x >= width) \ x = width - 1; \ else \ x = new_x; \ if (decom) { \ min_y = top; \ max_y = bottom; \ } else { \ min_y = 0; \ max_y = height; \ } \ if (new_y < min_y) \ y = min_y; \ else if (new_y >= max_y) \ y = max_y - 1; \ else \ y = new_y; \ [ts ts_goto: x:y]; \ } while (0) #define gotoxay(foo,nx,ny) gotoxy(foo,nx,decom?top+ny:ny) #define save_cur(foo) do { \ saved_x = x; \ saved_y = y; \ s_intensity = intensity; \ s_underline = underline; \ s_blink = blink; \ s_reverse = reverse; \ s_charset = charset; \ s_color = color; \ saved_G0 = G0_charset; \ saved_G1 = G1_charset; \ } while (0) #define restore_cur(foo) do { \ gotoxy(currcons,saved_x,saved_y); \ intensity = s_intensity; \ underline = s_underline; \ blink = s_blink; \ reverse = s_reverse; \ charset = s_charset; \ color = s_color; \ G0_charset = saved_G0; \ G1_charset = saved_G1; \ translate = set_translate(charset ? G1_charset : G0_charset,currcons); \ } while (0) -(void) _reset_terminal { top = 0; bottom = height; vc_state = ESnormal; ques = 0; translate = set_translate(LAT1_MAP,currcons); G0_charset = LAT1_MAP; G1_charset = GRAF_MAP; charset = 0; // report_mouse = 0; utf = 0; utf_count = 0; disp_ctrl = 0; toggle_meta = 0; decscnm = 0; decom = 0; decawm = 1; deccm = 1; decim = 0; #if 0 set_kbd(decarm); clr_kbd(decckm); clr_kbd(kbdapplic); clr_kbd(lnm); kbd_table[currcons].lockstate = 0; kbd_table[currcons].slockstate = 0; kbd_table[currcons].ledmode = LED_SHOW_FLAGS; kbd_table[currcons].ledflagstate = kbd_table[currcons].default_ledflagstate; set_leds(); cursor_type = CUR_DEFAULT; complement_mask = s_complement_mask; #endif [self _default_attr]; [self _update_attr]; tab_stop[0]= 0x01010100; tab_stop[1]=tab_stop[2]=tab_stop[3]=tab_stop[4]= tab_stop[5]=tab_stop[6]=tab_stop[7]=0x01010101; gotoxy(currcons,0,0); save_cur(currcons); [self _csi_J: 2]; } -(void) _csi_J: (int) vpar { unsigned int count; int start; switch (vpar) { case 0: /* erase from cursor to end of display */ count = width*height-(x+y*width); start = SCREEN(x,y); break; case 1: /* erase from start to cursor */ count = x+y*width+1; start = SCREEN(0,0); break; case 2: /* erase whole display */ count = width*height; start = SCREEN(0,0); break; default: return; } [ts ts_putChar: video_erase_char count: count offset: start]; } -(void) _csi_K: (int)vpar { unsigned int count; int start; switch (vpar) { case 0: /* erase from cursor to end of line */ count = width-x; start = SCREEN(x,y); break; case 1: /* erase from start of line to cursor */ count = x+1; start = SCREEN(0,y); break; case 2: /* erase whole line */ count = width; start = SCREEN(0,y); break; default: return; } [ts ts_putChar: video_erase_char count: count offset: start]; } -(void) _csi_X: (int)vpar /* erase the following vpar positions */ { /* not vt100? */ int count; if (!vpar) vpar++; count = (vpar > width-x) ? (width-x) : vpar; [ts ts_putChar: video_erase_char count: count offset: SCREEN(x,y)]; } -(void) _default_attr { intensity = 1; underline = 0; reverse = 0; blink = 0; color = def_color; } -(void) _update_attr { video_erase_char.color=color; video_erase_char.attr=(intensity)|(underline<<2)|(reverse<<3)|(blink<<4); } static unsigned char color_table[] = { 0, 4, 2, 6, 1, 5, 3, 7, 8,12,10,14, 9,13,11,15 }; -(void) _csi_m { int i; for (i=0;i<=npar;i++) switch (par[i]) { case 0: /* all attributes off */ [self _default_attr]; break; case 1: intensity = 2; break; case 2: intensity = 0; break; case 4: underline = 1; break; case 5: blink = 1; break; case 7: reverse = 1; break; case 10: /* ANSI X3.64-1979 (SCO-ish?) * Select primary font, don't display * control chars if defined, don't set * bit 8 on output. */ translate = set_translate(charset == 0 ? G0_charset : G1_charset,currcons); disp_ctrl = 0; toggle_meta = 0; break; case 11: /* ANSI X3.64-1979 (SCO-ish?) * Select first alternate font, lets * chars < 32 be displayed as ROM chars. */ translate = set_translate(IBMPC_MAP,currcons); disp_ctrl = 1; toggle_meta = 0; break; case 12: /* ANSI X3.64-1979 (SCO-ish?) * Select second alternate font, toggle * high bit before displaying as ROM char. */ translate = set_translate(IBMPC_MAP,currcons); disp_ctrl = 1; toggle_meta = 1; break; case 21: case 22: intensity = 1; break; case 24: underline = 0; break; case 25: blink = 0; break; case 27: reverse = 0; break; case 38: /* ANSI X3.64-1979 (SCO-ish?) * Enables underscore, white foreground * with white underscore (Linux - use * default foreground). */ color = (def_color & 0x0f) | background; underline = 1; break; case 39: /* ANSI X3.64-1979 (SCO-ish?) * Disable underline option. * Reset colour to default? It did this * before... */ color = (def_color & 0x0f) | background; underline = 0; break; case 49: color = (def_color & 0xf0) | foreground; break; default: if (par[i] >= 30 && par[i] <= 37) color = color_table[par[i]-30] | background; else if (par[i] >= 40 && par[i] <= 47) color = (color_table[par[i]-40]<<4) | foreground; break; } [self _update_attr]; } #define scrup(foo,t,b,nr,indirect_scroll) do { \ int scrup_nr=nr; \ \ if (t+scrup_nr >= b) \ scrup_nr = b - t - 1; \ if (b > height || t >= b || scrup_nr < 1) \ return; \ [ts ts_scrollUp: t:b rows: scrup_nr save: indirect_scroll]; \ [ts ts_putChar: video_erase_char count: width*scrup_nr offset: width*(b-scrup_nr)]; \ } while (0) #define scrdown(foo,t,b,nr) do { \ unsigned int step; \ int scrdown_nr=nr; \ \ if (t+scrdown_nr >= b) \ scrdown_nr = b - t - 1; \ if (b > height || t >= b || scrdown_nr < 1) \ return; \ step = width * scrdown_nr; \ [ts ts_scrollDown: t:b rows: scrdown_nr]; \ [ts ts_putChar: video_erase_char count: step offset: t*width]; \ } while (0) #define insert_char(foo,nr) do { \ [ts ts_shiftRow: y at: x delta: nr]; \ [ts ts_putChar: video_erase_char count: nr at: x:y]; \ } while (0) #define delete_char(foo,nr) do { \ [ts ts_shiftRow: y at: x+nr delta: -nr]; \ [ts ts_putChar: video_erase_char count: nr at: width-nr:y]; \ } while (0) -(void) _csi_at: (unsigned int)nr { if (nr > width - x) nr = width - x; else if (!nr) nr = 1; insert_char(currcons, nr); } -(void) _csi_L: (unsigned int)nr { if (nr > height - y) nr = height - y; else if (!nr) nr = 1; scrdown(foo,y,bottom,nr); } -(void) _csi_P: (unsigned int)nr { if (nr > width - x) nr = width - x; else if (!nr) nr = 1; delete_char(currcons, nr); } -(void) _csi_M: (unsigned int)nr { if (nr > height - y) nr = height - y; else if (!nr) nr=1; scrup(foo,y,bottom,nr,NO); } #define set_kbd(foo) #define clr_kbd(foo) #define set_mode(foo,on_off) [self _set_mode: on_off] -(void) _set_mode: (int) on_off { int i; for (i=0; i<=npar; i++) if (ques) switch(par[i]) { /* DEC private modes set/reset */ case 1: /* Cursor keys send ^[Ox/^[[x */ if (on_off) { set_kbd(decckm); } else { clr_kbd(decckm); } break; case 3: /* 80/132 mode switch unimplemented */ NSDebugLLog(@"term",@"ignore _set_mode 3"); #if 0 deccolm = on_off; (void) vc_resize(height, deccolm ? 132 : 80); /* this alone does not suffice; some user mode utility has to change the hardware regs */ #endif break; case 5: /* Inverted screen on/off */ if (decscnm != on_off) { decscnm = on_off; [self _update_attr]; /* TODO? */ } break; case 6: /* Origin relative/absolute */ decom = on_off; gotoxay(currcons,0,0); break; case 7: /* Autowrap on/off */ decawm = on_off; break; case 8: /* Autorepeat on/off */ NSDebugLLog(@"term",@"ignore _set_mode 8"); #if 0 if (on_off) set_kbd(decarm); else clr_kbd(decarm); #endif break; case 9: NSDebugLLog(@"term",@"ignore _set_mode 9"); #if 0 report_mouse = on_off ? 1 : 0; #endif break; case 25: /* Cursor on/off */ deccm = on_off; break; case 1000: NSDebugLLog(@"term",@"ignore _set_mode 1000"); #if 0 report_mouse = on_off ? 2 : 0; #endif break; } else switch(par[i]) { /* ANSI modes set/reset */ case 3: /* Monitor (display ctrls) */ disp_ctrl = on_off; break; case 4: /* Insert Mode on/off */ decim = on_off; break; case 20: /* Lf, Enter == CrLf/Lf */ NSDebugLLog(@"term",@"ignore _set_mode 20"); #if 0 if (on_off) set_kbd(lnm); else clr_kbd(lnm); #endif break; } } #define setterm_command(foo) [self _setterm_command] -(void) _setterm_command { NSDebugLLog(@"term",@"ignore _setterm_command %i\n",par[0]); /* TODO: will need _update_attr */ switch(par[0]) { #if 0 case 1: /* set color for underline mode */ if (can_do_color && par[1] < 16) { ulcolor = color_table[par[1]]; if (underline) update_attr(currcons); } break; case 2: /* set color for half intensity mode */ if (can_do_color && par[1] < 16) { halfcolor = color_table[par[1]]; if (intensity == 0) update_attr(currcons); } break; #endif case 8: /* store colors as defaults */ def_color = color; /* if (hi_font_mask == 0x100) def_color >>= 1;*/ [self _default_attr]; [self _update_attr]; break; #if 0 case 9: /* set blanking interval */ blankinterval = ((par[1] < 60) ? par[1] : 60) * 60 * HZ; poke_blanked_console(); break; case 10: /* set bell frequency in Hz */ if (npar >= 1) bell_pitch = par[1]; else bell_pitch = DEFAULT_BELL_PITCH; break; case 11: /* set bell duration in msec */ if (npar >= 1) bell_duration = (par[1] < 2000) ? par[1]*HZ/1000 : 0; else bell_duration = DEFAULT_BELL_DURATION; break; case 12: /* bring specified console to the front */ if (par[1] >= 1 && vc_cons_allocated(par[1]-1)) set_console(par[1] - 1); break; case 13: /* unblank the screen */ poke_blanked_console(); break; case 14: /* set vesa powerdown interval */ vesa_off_interval = ((par[1] < 60) ? par[1] : 60) * 60 * HZ; break; #endif } } -(void) processByte: (unsigned char)c { #define lf() do { \ if (y+1==bottom) \ { \ scrup(foo,top,bottom,1,(top==0 && bottom==height)?YES:NO); \ } \ else if (y0) \ { \ y--; \ [ts ts_goto: x:y]; \ } \ } while (0) #define cr() do { x=0; [ts ts_goto: x:y]; } while (0) #define cursor_report(foo,bar) do { \ char buf[40]; \ \ sprintf(buf, "\033[%d;%dR", y + (decom ? top+1 : 1), x+1); \ [ts ts_sendCString: buf]; \ } while (0) #define status_report(foo) do { \ [ts ts_sendCString: "\033[0n"]; \ } while (0) #define VT102ID "\033[?6c" #define respond_ID(foo) do { [ts ts_sendCString: VT102ID]; } while (0) switch (c) { case 0: return; case 7: if (vc_state==EStitle_buf) { NSString *new_title; title_buf[title_len]=0; new_title=[NSString stringWithCString: title_buf]; [ts ts_setTitle: new_title type: title_type]; vc_state=ESnormal; return; } NSBeep(); return; case 8: if (x>0) { x--; [ts ts_goto: x:y]; } return; case 9: while (x < width - 1) { x++; if (tab_stop[x >> 5] & (1 << (x & 31))) break; } [ts ts_goto: x:y]; return; case 10: case 11: case 12: lf(); /* if (!is_kbd(lnm))*/ return; case 13: cr(); return; case 14: charset = 1; translate = set_translate(G1_charset,currcons); disp_ctrl = 1; return; case 15: charset = 0; translate = set_translate(G0_charset,currcons); disp_ctrl = 0; return; case 24: case 26: vc_state = ESnormal; return; case 27: vc_state = ESesc; return; case 127: // del(currcons); return; case 128+27: // This kills UTF-8 unless we do some funky stuff if (!utf_count) { vc_state = ESsquare; return; } } switch(vc_state) { case ESesc: vc_state = ESnormal; switch (c) { case '[': vc_state = ESsquare; return; case ']': vc_state = ESnonstd; return; case '%': vc_state = ESpercent; return; case 'E': cr(); lf(); return; case 'M': ri(); return; case 'D': lf(); return; case 'H': tab_stop[x >> 5] |= (1 << (x & 31)); return; case 'Z': respond_ID(foo); return; case '7': save_cur(currcons); return; case '8': restore_cur(currcons); return; case '(': vc_state = ESsetG0; return; case ')': vc_state = ESsetG1; return; case '#': vc_state = EShash; return; case 'c': [self _reset_terminal]; return; case '>': /* Numeric keypad */ NSDebugLLog(@"term",@"ignore ESesc > keypad"); #if 0 clr_kbd(kbdapplic); #endif return; case '=': /* Appl. keypad */ NSDebugLLog(@"term",@"ignore ESesc = keypad"); #if 0 set_kbd(kbdapplic); #endif return; } return; case ESnonstd: switch (c) { case '0': case '1': case '2': vc_state=EStitle_semi; title_type=c-'0'; return; case 'P': NSDebugLLog(@"term",@"ignore ESnonstd P"); #if 0 for (npar=0; npar='0'&&c<='9') || (c>='A'&&c<='F') || (c>='a'&&c<='f') ) { par[npar++] = (c>'9' ? (c&0xDF)-'A'+10 : c-'0') ; if (npar==7) { int i = par[0]*3, j = 1; palette[i] = 16*par[j++]; palette[i++] += par[j++]; palette[i] = 16*par[j++]; palette[i++] += par[j++]; palette[i] = 16*par[j++]; palette[i] += par[j]; set_palette(currcons); vc_state = ESnormal; } } else #endif vc_state = ESnormal; return; case ESsquare: for(npar = 0 ; npar < NPAR ; npar++) par[npar] = 0; npar = 0; vc_state = ESgetpars; if (c == '[') { /* Function key */ vc_state=ESfunckey; return; } ques = (c=='?'); if (ques) return; case ESgetpars: if (c==';' && npar='0' && c<='9') { par[npar] *= 10; par[npar] += c-'0'; return; } else vc_state=ESgotpars; case ESgotpars: vc_state = ESnormal; switch(c) { case 'h': set_mode(currcons,1); return; case 'l': set_mode(currcons,0); return; case 'c': NSDebugLLog(@"term",@"ignore ESgotpars c"); #if 0 if (ques) { if (par[0]) cursor_type = par[0] | (par[1]<<8) | (par[2]<<16); else cursor_type = CUR_DEFAULT; return; } #endif break; case 'n': if (!ques) { if (par[0] == 5) status_report(tty); else if (par[0] == 6) cursor_report(currcons,tty); } return; } if (ques) { ques = 0; return; } switch(c) { case 'G': case '`': if (par[0]) par[0]--; gotoxy(currcons,par[0],y); return; case 'A': if (!par[0]) par[0]++; gotoxy(currcons,x,y-par[0]); return; case 'B': case 'e': if (!par[0]) par[0]++; gotoxy(currcons,x,y+par[0]); return; case 'C': case 'a': if (!par[0]) par[0]++; gotoxy(currcons,x+par[0],y); return; case 'D': if (!par[0]) par[0]++; gotoxy(currcons,x-par[0],y); return; case 'E': if (!par[0]) par[0]++; gotoxy(currcons,0,y+par[0]); return; case 'F': if (!par[0]) par[0]++; gotoxy(currcons,0,y-par[0]); return; case 'd': if (par[0]) par[0]--; gotoxay(currcons,x,par[0]); return; case 'H': case 'f': if (par[0]) par[0]--; if (par[1]) par[1]--; gotoxay(currcons,par[1],par[0]); return; case 'J': csi_J(currcons,par[0]); return; case 'K': csi_K(currcons,par[0]); return; case 'L': csi_L(currcons,par[0]); return; case 'M': csi_M(currcons,par[0]); return; case 'P': csi_P(currcons,par[0]); return; case 'c': if (!par[0]) respond_ID(tty); return; case 'g': if (!par[0]) tab_stop[x >> 5] &= ~(1 << (x & 31)); else if (par[0] == 3) { tab_stop[0] = tab_stop[1] = tab_stop[2] = tab_stop[3] = tab_stop[4] = 0; } return; case 'm': csi_m(currcons); return; case 'q': /* DECLL - but only 3 leds */ /* map 0,1,2,3 to 0,1,2,4 */ NSDebugLLog(@"term",@"ignore ESgotpars q"); #if 0 if (par[0] < 4) setledstate(kbd_table + currcons, (par[0] < 3) ? par[0] : 4); #endif return; case 'r': if (!par[0]) par[0]++; if (!par[1]) par[1] = height; /* Minimum allowed region is 2 lines */ if (par[0] < par[1] && par[1] <= height) { top=par[0]-1; bottom=par[1]; gotoxay(currcons,0,0); } return; case 's': save_cur(currcons); return; case 'u': restore_cur(currcons); return; case 'X': csi_X(currcons, par[0]); return; case '@': csi_at(currcons,par[0]); return; case ']': /* setterm functions */ setterm_command(currcons); return; } return; case ESpercent: vc_state = ESnormal; switch (c) { case '@': /* defined in ISO 2022 */ utf = 0; return; case 'G': /* prelim official escape code */ case '8': /* retained for compatibility */ utf = 1; return; } return; case ESfunckey: vc_state = ESnormal; return; case EShash: vc_state = ESnormal; NSDebugLLog(@"term",@"ignore EShash"); #if 0 if (c == '8') { /* DEC screen alignment test. kludge :-) */ video_erase_char = (video_erase_char & 0xff00) | 'E'; csi_J(currcons, 2); video_erase_char = (video_erase_char & 0xff00) | ' '; do_update_region(currcons, origin, screenbuf_size/2); } #endif return; case ESsetG0: if (c == '0') G0_charset = GRAF_MAP; else if (c == 'B') G0_charset = LAT1_MAP; else if (c == 'U') G0_charset = IBMPC_MAP; else if (c == 'K') G0_charset = USER_MAP; if (charset == 0) translate = set_translate(G0_charset,currcons); vc_state = ESnormal; return; case ESsetG1: if (c == '0') G1_charset = GRAF_MAP; else if (c == 'B') G1_charset = LAT1_MAP; else if (c == 'U') G1_charset = IBMPC_MAP; else if (c == 'K') G1_charset = USER_MAP; if (charset == 1) translate = set_translate(G1_charset,currcons); vc_state = ESnormal; return; default: vc_state = ESnormal; if (utf && c>0x7f) { if (utf_count && (c&0xc0)==0x80) { unich=(unich<<6)|(c&0x3f); utf_count--; if (utf_count) return; } else { if ((c & 0xe0) == 0xc0) { utf_count = 1; unich = (c & 0x1f); } else if ((c & 0xf0) == 0xe0) { utf_count = 2; unich = (c & 0x0f); } else if ((c & 0xf8) == 0xf0) { utf_count = 3; unich = (c & 0x07); } else if ((c & 0xfc) == 0xf8) { utf_count = 4; unich = (c & 0x03); } else if ((c & 0xfe) == 0xfc) { utf_count = 5; unich = (c & 0x01); } else utf_count = 0; return; } } else if (!iconv_state || translate!=translate_maps[0]) { if (toggle_meta) c|=0x80; unich=translate[c]; } else #define PUTCH \ if (x>=width && decawm) \ { \ cr(); \ lf(); \ } \ char_width=[ts relativeWidthOfCharacter: ch.ch]; \ if (decim) \ [ts ts_shiftRow: y at: x delta: char_width]; \ [ts ts_putChar: ch count: 1 at: x:y]; \ if (xwidth) \ char_width=width-x; \ if (char_width>0) \ { \ ch.ch=MULTI_CELL_GLYPH; \ [ts ts_putChar: ch count: char_width at: x:y]; \ x+=char_width; \ } \ [ts ts_goto: x:y]; \ } { screen_char_t ch; char *inp; size_t in_size; char *outp; size_t out_size; int char_width; int ret; if (toggle_meta) c|=0x80; /* TODO: there might be other cases where we should clear the buffer */ if (input_buf_len==sizeof(input_buf)) { NSLog(@"Warning: iconv() input buffer overrun!"); input_buf_len=0; } input_buf[input_buf_len++]=c; ch.color=color; ch.attr=(intensity)|(underline<<2)|(reverse<<3)|(blink<<4); inp=(char *)input_buf; in_size=input_buf_len; do { outp=(char *)&unich; out_size=4; utf_count=0; // reset the non-internal utf count ret=iconv(iconv_state,(char **)&inp,&in_size,&outp,&out_size); if (out_size==0) { ch.ch=ntohl(unich); PUTCH } if (ret>=0) break; if (errno==EILSEQ) { /* illegal input sequence. skip one byte and try again. */ ch.ch=0xfffd; PUTCH in_size--; inp++; } if (errno==EINVAL) { /* incomplete input sequence. wait for more input. */ utf_count=1; // FIXME: is this the right thing to do? break; } /* keep going while there's more input and the error was lack of output space */ } while (in_size>0 && errno==E2BIG); /* adjust the buffer */ if (in_size!=input_buf_len) { if (in_size) memmove(input_buf,inp,in_size); input_buf_len=in_size; } return; } { screen_char_t ch; int char_width; ch.color=color; ch.attr=(intensity)|(underline<<2)|(reverse<<3)|(blink<<4); ch.ch=unich; PUTCH } return; #undef PUTCH } } /* Translates '\n' to '\r' when sending. */ -(void) sendString: (NSString *)s { int l=[s length]; unsigned int ucs; int i; if (iconv_input_state) { unsigned int *inp; size_t insize; char *outp; char buf[16+1]; size_t outsize; int ret; for (i=0;i1) { s=[e characters]; NSDebugLLog(@"key",@" writing '%@'\n",s); [self sendString: s]; return; } ch=[s characterAtIndex: 0]; str=NULL; nstr=nil; ch2=0; switch (ch) { case '\e': if ([TerminalViewKeyboardPrefs doubleEscape]) str="\e\e"; else str="\e"; break; case NSUpArrowFunctionKey : str="\e[A"; break; case NSDownArrowFunctionKey : str="\e[B"; break; case NSLeftArrowFunctionKey : str="\e[D"; break; case NSRightArrowFunctionKey: str="\e[C"; break; case NSF1FunctionKey : str="\e[[A"; break; case NSF2FunctionKey : str="\e[[B"; break; case NSF3FunctionKey : str="\e[[C"; break; case NSF4FunctionKey : str="\e[[D"; break; case NSF5FunctionKey : str="\e[[E"; break; case NSF6FunctionKey : str="\e[17~"; break; case NSF7FunctionKey : str="\e[18~"; break; case NSF8FunctionKey : str="\e[19~"; break; case NSF9FunctionKey : str="\e[20~"; break; case NSF10FunctionKey: str="\e[21~"; break; case NSF11FunctionKey: str="\e[23~"; break; case NSF12FunctionKey: str="\e[24~"; break; case NSF13FunctionKey: str="\e[25~"; break; case NSF14FunctionKey: str="\e[26~"; break; case NSF15FunctionKey: str="\e[28~"; break; case NSF16FunctionKey: str="\e[29~"; break; case NSF17FunctionKey: str="\e[31~"; break; case NSF18FunctionKey: str="\e[32~"; break; case NSF19FunctionKey: str="\e[33~"; break; case NSF20FunctionKey: str="\e[34~"; break; case NSHomeFunctionKey : str="\e[1~"; break; case NSInsertFunctionKey : str="\e[2~"; break; case NSDeleteFunctionKey : str="\e[3~"; break; case NSEndFunctionKey : str="\e[4~"; break; case NSPageUpFunctionKey : str="\e[5~"; break; case NSPageDownFunctionKey: str="\e[6~"; break; case 9: // tab if (mask&NSShiftKeyMask) str="\e[Z"; else nstr=[e characters]; break; case 8: ch2=0x7f; break; case 3: ch2=0x0d; break; default: nstr=[e characters]; break; } { BOOL commandAsMeta=[TerminalViewKeyboardPrefs commandAsMeta]; /* Thanks to different keyboard layouts and dumb default key handling in GNUstep, this is a bit complex. There seem to be two main cases: a. GNUstep has been correctly configured. Command is really command, alternate is really alternate, and is used as meta. AltGr isn't anything at all. No special options necessary. b. GNUstep is using the default settings. Left alt is command, right alt (which might be AltGr) is alternate. Users seem to actually want left alt to be meta, and, if right alt is AltGr, right alt not to be meta. Thus, when command-as-meta option is active, we intercept command presses and treat them as meta, and we ignore alternate. */ if ((commandAsMeta && (mask&NSCommandKeyMask)) || (!commandAsMeta && (mask&NSAlternateKeyMask))) { NSDebugLLog(@"key",@" meta"); [ts ts_sendCString: "\e"]; } } if (nstr) { NSDebugLLog(@"key",@" send NSString '%@'",nstr); [self sendString: nstr]; } else if (str) { NSDebugLLog(@"key",@" send '%s'",str); [ts ts_sendCString: str]; } else if (ch2>256) { NSDebugLLog(@"key",@" couldn't send %04x",ch2); NSBeep(); } else if (ch2>0) { unsigned char tmp; tmp=ch2; NSDebugLLog(@"key",@" send %02x",ch2); [ts ts_sendCString: (char *)&tmp length: 1]; } } - initWithTerminalScreen: (id)ats width: (int)w height: (int)h { const char *iconv_charset; if (!(self=[super init])) return nil; ts=ats; width=w; height=h; color=def_color=0x07; [self _reset_terminal]; iconv_charset=[TerminalParser_LinuxPrefs characterSet]; if (strcmp(iconv_charset,"iso-8859-1")) { iconv_state=iconv_open("ucs-4",iconv_charset); if (iconv_state==(iconv_t)-1) { iconv_state=NULL; NSLog(@"Warning: unable to create iconv handle for conversion from '%s'!", iconv_charset); NSLog(@"Falling back to iso-8859-1 (latin1)."); } iconv_input_state=iconv_open(iconv_charset,"ucs-4"); if (iconv_input_state==(iconv_t)-1) { iconv_input_state=NULL; NSLog(@"Warning: unable to create iconv handle for conversion to '%s'!", iconv_charset); NSLog(@"Falling back to iso-8859-1 (latin1)."); } } return self; } -(void) dealloc { if (iconv_state) iconv_close(iconv_state); if (iconv_input_state) iconv_close(iconv_input_state); [super dealloc]; } -(void) setTerminalScreenWidth: (int)w height: (int)h { y+=h-height; width=w; height=h; top=0; bottom=height; if (x>=width) x=width-1; if (x<0) x=0; if (y>=height) y=height-1; if (y<0) y=0; } @end Terminal-0.9.8/TerminalWindowPrefs.m0000644000175000001440000001175711471062127016701 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg 2009-2010 GAP Project This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #import #import #import #import #import #import #import #import #import #import "Label.h" #include "TerminalWindowPrefs.h" static NSUserDefaults *ud; static NSString *WindowCloseBehaviorKey=@"WindowCloseBehavior", *WindowHeightKey=@"WindowHeight", *WindowWidthKey=@"WindowWidth", *AddYBordersKey=@"AddYBorders"; static int windowCloseBehavior; static int windowWidth,windowHeight; static BOOL addYBorders; @implementation TerminalWindowPrefs +(void) initialize { if (!ud) { ud=[NSUserDefaults standardUserDefaults]; windowCloseBehavior=[ud integerForKey: WindowCloseBehaviorKey]; windowWidth=[ud integerForKey: WindowWidthKey]; windowHeight=[ud integerForKey: WindowHeightKey]; addYBorders=[ud boolForKey: AddYBordersKey]; if (windowWidth<=0) windowWidth=80; if (windowHeight<=0) windowHeight=25; } } +(int) windowCloseBehavior { return windowCloseBehavior; } +(int) defaultWindowWidth { return windowWidth; } +(int) defaultWindowHeight { return windowHeight; } +(BOOL) addYBorders { return addYBorders; } -(void) save { if (!top) return; windowCloseBehavior=[[m_close selectedCell] tag]; [ud setInteger: windowCloseBehavior forKey: WindowCloseBehaviorKey]; addYBorders=[b_addYBorders state]; [ud setBool: addYBorders forKey: AddYBordersKey]; windowWidth=[tf_width intValue]; windowHeight=[tf_height intValue]; if (windowWidth<=0) windowWidth=80; if (windowHeight<=0) windowHeight=25; [ud setInteger: windowWidth forKey: WindowWidthKey]; [ud setInteger: windowHeight forKey: WindowHeightKey]; } -(void) revert { [m_close selectCellWithTag: windowCloseBehavior]; [tf_width setIntValue: windowWidth]; [tf_height setIntValue: windowHeight]; [b_addYBorders setState: addYBorders]; } -(NSString *) name { return _(@"Terminal Window"); } -(void) setupButton: (NSButton *)b { [b setTitle: _(@"Terminal\nWindow")]; [b sizeToFit]; } -(void) willHide { } -(NSView *) willShow { if (!top) { top=[[GSVbox alloc] init]; [top setDefaultMinYMargin: 1]; { NSTextField *f; { NSMatrix *m; NSButtonCell *b=[NSButtonCell new]; NSSize s,s2; [b setButtonType: NSRadioButton]; m=m_close=[[NSMatrix alloc] initWithFrame: NSMakeRect(0,0,1,1) mode: NSRadioModeMatrix prototype: b numberOfRows: 2 numberOfColumns: 1]; [m setAutoresizingMask: NSViewMinXMargin|NSViewMaxXMargin| NSViewMinYMargin|NSViewMaxYMargin]; [[m cellAtRow: 0 column: 0] setTitle: _(@"Close new windows when idle")]; [[m cellAtRow: 1 column: 0] setTitle: _(@"Don't close new windows")]; [[m cellAtRow: 0 column: 0] setTag: 0]; [[m cellAtRow: 1 column: 0] setTag: 1]; s=[[m cellAtRow: 0 column: 0] cellSize]; s2=[[m cellAtRow: 0 column: 0] cellSize]; if (s2.width>s.width) s.width=s2.width; [m setCellSize: s]; [m setIntercellSpacing: NSMakeSize(0,3)]; [m sizeToCells]; [top addView: m enablingYResizing: YES]; DESTROY(m); } { NSBox *b; GSTable *t; b=[[NSBox alloc] init]; [b setAutoresizingMask: NSViewWidthSizable|NSViewMinYMargin|NSViewMaxYMargin]; [b setTitle: _(@"Default size")]; t=[[GSTable alloc] initWithNumberOfRows: 2 numberOfColumns: 2]; f=[NSTextField newLabel: _(@"Width:")]; [f setAutoresizingMask: NSViewMinXMargin|NSViewMinYMargin|NSViewMaxYMargin]; [t putView: f atRow: 1 column: 0 withXMargins: 2 yMargins: 2]; tf_width=f=[[NSTextField alloc] init]; [f setAutoresizingMask: NSViewWidthSizable]; [f sizeToFit]; [t putView: f atRow: 1 column: 1]; [f release]; f=[NSTextField newLabel: _(@"Height:")]; [f setAutoresizingMask: NSViewMinXMargin|NSViewMinYMargin|NSViewMaxYMargin]; [t putView: f atRow: 0 column: 0 withXMargins: 2 yMargins: 2]; tf_height=f=[[NSTextField alloc] init]; [f setAutoresizingMask: NSViewWidthSizable]; [f sizeToFit]; [t putView: f atRow: 0 column: 1]; [f release]; [b setContentView: t]; [b sizeToFit]; DESTROY(t); [top addView: b enablingYResizing: YES]; DESTROY(b); } { NSButton *b; b=b_addYBorders=[[NSButton alloc] init]; [b setAutoresizingMask: NSViewMinXMargin|NSViewMaxXMargin|NSViewMinYMargin|NSViewMaxYMargin]; [b setButtonType: NSSwitchButton]; [b setTitle: _(@"Add top and bottom border")]; [b sizeToFit]; [top addView: b enablingYResizing: YES]; } } [self revert]; } return top; } -(void) dealloc { DESTROY(top); [super dealloc]; } @end Terminal-0.9.8/Russian.lproj/0000755000175000001440000000000011667362252015327 5ustar multixusersTerminal-0.9.8/Russian.lproj/Localizable.strings0000644000175000001440000002173311016341203021146 0ustar multixusers /* Translated by Dmitriy Kostiuk . */ /*** Russian.lproj/Localizable.strings updated by make_strings 2002-12-09 18:39:08 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:653 */ "Command line:" = "ÐšÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрока:"; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:78 */ "Apply and save" = "Применить и Ñохранить"; /* File: PreferencesWindowController.m:122 */ "Preferences" = "ÐаÑтройки"; /* File: PreferencesWindowController.m:70 */ "Revert" = "ВоÑÑтановить"; /*** Strings from Services.m ***/ /* File: Services.m:152 */ "Service aborted by user." = "Ð¡ÐµÑ€Ð²Ð¸Ñ Ð¾Ñ‚Ð¼ÐµÐ½ÐµÐ½ пользователем."; /* File: Services.m:60 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "Ðет ÑервиÑа терминала Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼ '%@'.\nВероÑтно, ваш ÑпиÑок ÑервиÑов уÑтарел.\nВыполните 'make_services' Ð´Ð»Ñ ÐµÐ³Ð¾ обновлениÑ."; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Отмена"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /* File: ServicesParameterWindowController.m:118 */ "Parameter for service %@" = "Параметр Ð´Ð»Ñ ÑервиÑа %@"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:585 */ "Accept types" = "Принимать"; /* File: ServicesPrefs.m:499 */ "Add" = "Добавить"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Ошибка импорта ÑервиÑов"; /* File: ServicesPrefs.m:401 */ "Export services" = "ЭкÑпорт ÑервиÑов"; /* File: ServicesPrefs.m:523 */ "Export..." = "ЭкÑпорт..."; /* File: ServicesPrefs.m:594 */ "Filenames" = "Имена файлов"; /* File: ServicesPrefs.m:549 */ "Ignore output" = "Игнорировать вывод"; /* File: ServicesPrefs.m:254 */ "Import services" = "Импорт ÑервиÑов"; /* File: ServicesPrefs.m:515 */ "Import..." = "Импорт..."; /* File: ServicesPrefs.m:559 */ "Input in stdin" = "Ввод из stdin"; /* File: ServicesPrefs.m:560 */ "Input on command line" = "Ввод из командной Ñтроки"; /* File: ServicesPrefs.m:640 */ "Key:" = "Клавиша:"; /* File: ServicesPrefs.m:627 */ "Name:" = "ИмÑ:"; /* File: ServicesPrefs.m:558 */ "No input" = "Без ввода"; /* File: ServicesPrefs.m:602 */ "Plain text" = "Plain text"; /* File: ServicesPrefs.m:507 */ "Remove" = "Удалить"; /* File: ServicesPrefs.m:550 */ "Return output" = "Возвращать вывод"; /* File: ServicesPrefs.m:568 */ "Run in background" = "ЗапуÑкать в фоне"; /* File: ServicesPrefs.m:570 */ "Run in idle window" = "ЗапуÑкать в Ñвободном окне"; /* File: ServicesPrefs.m:569 */ "Run in new window" = "ЗапуÑкать в новом окне"; /* File: ServicesPrefs.m:468 */ "Terminal services" = "СервиÑÑ‹ терминала"; /* File: ServicesPrefs.m:473 */ "Terminal\nservices" = "СервиÑÑ‹\nтерминала"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "Файл '%@' не Ñодержит допуÑтимых ÑервиÑов терминала."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "БезымÑнный ÑервиÑ"; /*** Strings from TerminalParser_LinuxPrefs.m ***/ /* File: TerminalParser_LinuxPrefs.m:103 */ "'linux' terminal parser" = "Терминальный парÑер 'linux'"; /* File: TerminalParser_LinuxPrefs.m:108 */ "'linux'\nparser" = "ПарÑер\n'linux'"; /* File: TerminalParser_LinuxPrefs.m:151 */ "Character set:" = "Ðабор Ñимволов:"; /* File: TerminalParser_LinuxPrefs.m:43 */ "Chinese" = "Chinese"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Custom, leave unchanged" = "ПользовательÑкий, оÑтавить без изменений"; /* File: TerminalParser_LinuxPrefs.m:42 */ "East Europe, latin2" = "ВоÑÑ‚Ð¾Ñ‡Ð½Ð°Ñ Ð•Ð²Ñ€Ð¾Ð¿Ð°, latin2"; /* File: TerminalParser_LinuxPrefs.m:40 */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:41 */ "West Europe, latin1" = "Ð—Ð°Ð¿Ð°Ð´Ð½Ð°Ñ Ð•Ð²Ñ€Ð¾Ð¿Ð°, latin1"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1623 */ "Unable to fork: %m." = "Ðе удаетÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÑŒ форк: %m."; /* File: TerminalView.m:1611 */ "Unable to open pipe for input: %m." = "Ðе удаетÑÑ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚ÑŒ пайп Ð´Ð»Ñ Ð²Ð²Ð¾Ð´Ð°: %m."; /* File: TerminalView.m:1476 */ "[Process exited]" = "[ПроцеÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»ÑÑ]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:330 */ "Bold font:" = "Жирный шрифт:"; /* File: TerminalViewPrefs.m:298 */ "Color:" = "Цвет:"; /* File: TerminalViewPrefs.m:277 */ "Cursor" = "КурÑор"; /* File: TerminalViewPrefs.m:230 */ /* File: TerminalViewPrefs.m:225 */ "Display" = "ДиÑплей"; /* File: TerminalViewPrefs.m:291 */ "Filled block" = "Заполненный блок"; /* File: TerminalViewPrefs.m:319 */ "Handle wide (multi-cell) glyphs" = "Оперировать широкими (в неÑколько позиций) Ñимволами"; /* File: TerminalViewPrefs.m:292 */ "Inverted block" = "Инвертированный блок"; /* File: TerminalViewPrefs.m:607 */ /* File: TerminalViewPrefs.m:602 */ "Keyboard" = "Клавиатура"; /* File: TerminalViewPrefs.m:289 */ "Line" = "Строка"; /* File: TerminalViewPrefs.m:357 */ "Normal font:" = "Ðормальный шрифт:"; /* File: TerminalViewPrefs.m:369 */ /* File: TerminalViewPrefs.m:342 */ "Pick font..." = "Выбрать шрифт..."; /* File: TerminalViewPrefs.m:255 */ "Scroll-back length in lines:" = "Длина прокрутки в Ñтроках:"; /* File: TerminalViewPrefs.m:651 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "ПоÑылать двойной escape Ð´Ð»Ñ ÐºÐ»Ð°Ð²Ð¸ÑˆÐ¸ escape.\n\nЭто означает, что клавиша escape будет\nраÑпознаватьÑÑ Ð±Ñ‹Ñтрее многими программами,\nно ее будет Ð½ÐµÐ»ÑŒÐ·Ñ Ð¸Ñпользовать вмеÑто meta."; /* File: TerminalViewPrefs.m:492 */ /* File: TerminalViewPrefs.m:487 */ "Shell" = "Оболочка"; /* File: TerminalViewPrefs.m:527 */ "Shell:" = "Оболочка:"; /* File: TerminalViewPrefs.m:515 */ "Start as login-shell" = "ЗапуÑкать как оболочку входа"; /* File: TerminalViewPrefs.m:290 */ "Stroked block" = "Заштрихованный блок"; /* File: TerminalViewPrefs.m:282 */ "Style:" = "Стиль:"; /* File: TerminalViewPrefs.m:634 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Обрабатывать command как meta.\n\nЕÑли разрешить Ñту опцию, не будет\nдоÑтупа к пунктам меню\nÑ ÐºÐ»Ð°Ð²Ð¸Ð°Ñ‚ÑƒÑ€Ñ‹."; /*** Strings from TerminalWindow.m ***/ /* File: TerminalWindow.m:192 */ /* File: TerminalWindow.m:188 */ " (idle)" = " (Ñвободно)"; /*** Strings from TerminalWindowPrefs.m ***/ /* File: TerminalWindowPrefs.m:192 */ "Add top and bottom border" = "Добавить верхнюю и нижнюю границы"; /* File: TerminalWindowPrefs.m:143 */ "Close new windows when idle" = "Закрывать новые окна при проÑтое"; /* File: TerminalWindowPrefs.m:156 */ "Default size" = "Размер по умолчанию"; /* File: TerminalWindowPrefs.m:144 */ "Don't close new windows" = "Ðе закрывать новые окна"; /* File: TerminalWindowPrefs.m:169 */ "Height:" = "Ð’Ñ‹Ñота:"; /* File: TerminalWindowPrefs.m:112 */ "Terminal Window" = "Окно терминала"; /* File: TerminalWindowPrefs.m:117 */ "Terminal\nWindow" = "Окно\nтерминала"; /* File: TerminalWindowPrefs.m:160 */ "Width:" = "Ширина:"; /*** Strings from main.m ***/ /* File: main.m:157 */ "Benchmark" = "ПроизводительноÑть"; /* File: main.m:191 */ "Close" = "Закрыть"; /* File: main.m:180 */ "Copy" = "Копировать"; /* File: main.m:177 */ "Cut" = "Вырезать"; /* File: main.m:186 */ "Edit" = "Редактировать"; /* File: main.m:203 */ "Hide" = "СпрÑтать"; /* File: main.m:159 */ "Info" = "ИнформациÑ"; /* File: main.m:153 */ "Info..." = "ИнформациÑ..."; /* File: main.m:171 */ "New terminal" = "Ðовый терминал"; /* File: main.m:183 */ "Paste" = "Ð’Ñтавить"; /* File: main.m:155 */ "Preferences..." = "ÐаÑтройки..."; /* File: main.m:207 */ "Quit" = "Выход"; /* File: main.m:199 */ "Services" = "СервиÑÑ‹"; /* File: main.m:194 */ "Windows" = "Окна"; Terminal-0.9.8/cursor_stroked.tiff0000644000175000001440000000262411561216225016473 0ustar multixusersMM*Ð Ð þÌÈ( Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø Àø ÀøÈÌÈÈÌÈÈÌÈÈÌÈ ÀøÈÌÈÈÌÈÈÌÈ ÀøÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ ÀøÈÌÈÈÌÈ ÀøÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ ÀøÈÌÈ ÀøÈÌÈÈÌÈÈÌÈ ÀøÈÌÈ ÀøÈÌÈÈÌÈÈÌÈÈÌÈ ÀøÈÌÈÈÌÈ ÀøÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈÈÌÈ ÀøÈÌÈÈÌÈÈÌÈ ÀøÈÌÈÈÌÈÈÌÈÈÌÈ Àø Àø Àø Àø Àø Àø Àø Àø ÀøTerminal-0.9.8/COPYING0000644000175000001440000004313111016341203013570 0ustar multixusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. Terminal-0.9.8/Turkish.lproj/0000755000175000001440000000000011667362252015334 5ustar multixusersTerminal-0.9.8/Turkish.lproj/Localizable.strings0000644000175000001440000001717511016341203021160 0ustar multixusers/* Turkish translation by Ahmet Soyata */ /*** Turkish.lproj/Localizable.strings updated by make_strings 2002-12-09 18:39:08 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:653 */ "Command line:" = "Komut satırı:"; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:78 */ "Apply and save" = "Uygula ve kaydet"; /* File: PreferencesWindowController.m:122 */ "Preferences" = "Seçenekler"; /* File: PreferencesWindowController.m:70 */ "Revert" = "Eski duruma dön"; /*** Strings from Services.m ***/ /* File: Services.m:152 */ "Service aborted by user." = "Hizmet kullanıcı tarafından iptal edildi"; /* File: Services.m:60 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = " '%@' adında bir hizmet yok.\nBelki hizmetleriniz güncellenmemiÅŸtir.\n 'make_services' komutu ile günceleyiniz."; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "İptal"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "Tamam"; /* File: ServicesParameterWindowController.m:118 */ "Parameter for service %@" = " %@ servisi için parametre"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:585 */ "Accept types" = "Kabul türleri"; /* File: ServicesPrefs.m:499 */ "Add" = "Ekle"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Servisleri yüklerken hata oluÅŸtu"; /* File: ServicesPrefs.m:401 */ "Export services" = "Hizmet ithal et"; /* File: ServicesPrefs.m:523 */ "Export..." = "... ithal et"; /* File: ServicesPrefs.m:594 */ "Filenames" = "Dosya isimleri"; /* File: ServicesPrefs.m:549 */ "Ignore output" = "Çıktıyı görmezden gel"; /* File: ServicesPrefs.m:254 */ "Import services" = "Hizmetler ihraç et"; /* File: ServicesPrefs.m:515 */ "Import..." = "... ihraç et"; /* File: ServicesPrefs.m:559 */ "Input in stdin" = "stdin'deki girdi"; /* File: ServicesPrefs.m:560 */ "Input on command line" = "Komut satırındaki girdi"; /* File: ServicesPrefs.m:640 */ "Key:" = "Anahtar:"; /* File: ServicesPrefs.m:627 */ "Name:" = "İsim:"; /* File: ServicesPrefs.m:558 */ "No input" = "Girdi yok"; /* File: ServicesPrefs.m:602 */ "Plain text" = "Sade yazı"; /* File: ServicesPrefs.m:507 */ "Remove" = "Kaldır"; /* File: ServicesPrefs.m:550 */ "Return output" = "Çıktıyı geri döndür"; /* File: ServicesPrefs.m:568 */ "Run in background" = "Arkaplanda çalış"; /* File: ServicesPrefs.m:570 */ "Run in idle window" = "Etkin pencerede çalış"; /* File: ServicesPrefs.m:569 */ "Run in new window" = "Yeni pencerede çalış"; /* File: ServicesPrefs.m:468 */ "Terminal services" = "Termianl hizmetleri"; /* File: ServicesPrefs.m:473 */ "Terminal\nservices" = "Terminal\nhizmetleri"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = " '%@' dosyası geçerli terminal hizmetleri içermiyor."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "İsimsiz hizmet"; /*** Strings from TerminalParser_LinuxPrefs.m ***/ /* File: TerminalParser_LinuxPrefs.m:103 */ "'linux' terminal parser" = "'linux' terminal ayrıştırma"; /* File: TerminalParser_LinuxPrefs.m:108 */ "'linux'\nparser" = "'linux'\nayrıştırma"; /* File: TerminalParser_LinuxPrefs.m:151 */ "Character set:" = "Karakter kümesi:"; /* File: TerminalParser_LinuxPrefs.m:43 */ "Chinese" = "Çince"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Custom, leave unchanged" = "DeÄŸiÅŸtirilmeden çık"; /* File: TerminalParser_LinuxPrefs.m:42 */ "East Europe, latin2" = "DoÄŸu Avrupa, latin2"; /* File: TerminalParser_LinuxPrefs.m:40 */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:41 */ "West Europe, latin1" = "Batı Avrupa, latin1"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1623 */ "Unable to fork: %m." = ": %m. çatallanamıyor"; /* File: TerminalView.m:1611 */ "Unable to open pipe for input: %m." = "Girdi %m. için boru açılamıyor"; /* File: TerminalView.m:1476 */ "[Process exited]" = "[Süreçten çıkıldı]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:330 */ "Bold font:" = "kalın yazıtipi:"; /* File: TerminalViewPrefs.m:298 */ "Color:" = "Renk:"; /* File: TerminalViewPrefs.m:277 */ "Cursor" = "İmleç"; /* File: TerminalViewPrefs.m:230 */ /* File: TerminalViewPrefs.m:225 */ "Display" = "Görüntü"; /* File: TerminalViewPrefs.m:291 */ "Filled block" = "Dolu blok"; /* File: TerminalViewPrefs.m:319 */ "Handle wide (multi-cell) glyphs" = "GeniÅŸ çok-hücreli glyph'ler tut"; /* File: TerminalViewPrefs.m:292 */ "Inverted block" = "Inverted block"; /* File: TerminalViewPrefs.m:607 */ /* File: TerminalViewPrefs.m:602 */ "Keyboard" = "Klavye"; /* File: TerminalViewPrefs.m:289 */ "Line" = "Satır"; /* File: TerminalViewPrefs.m:357 */ "Normal font:" = "Normal yazıtipi:"; /* File: TerminalViewPrefs.m:369 */ /* File: TerminalViewPrefs.m:342 */ "Pick font..." = "... yazıtipini al"; /* File: TerminalViewPrefs.m:255 */ "Scroll-back length in lines:" = "Satırlarda uzunluÄŸu scroll-back et:"; /* File: TerminalViewPrefs.m:651 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "Escape tuÅŸu için çift Esc girin.\n\nBöylece esc tuÅŸunu programlar\n daha hızlı tanıyabilir, ama\nbunum meta için yedek olarak kullanamazsınız."; /* File: TerminalViewPrefs.m:492 */ /* File: TerminalViewPrefs.m:487 */ "Shell" = "Kabuk"; /* File: TerminalViewPrefs.m:527 */ "Shell:" = "Kabuk:"; /* File: TerminalViewPrefs.m:515 */ "Start as login-shell" = "GiriÅŸ-kabuÄŸu olarak baÅŸla"; /* File: TerminalViewPrefs.m:290 */ "Stroked block" = "Hasarlı blok"; /* File: TerminalViewPrefs.m:282 */ "Style:" = "Stil:"; /* File: TerminalViewPrefs.m:634 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Komut anahtarı meta olarak davransın.\n\nBunu etkin hale getirince, klavyeyle\nmenülere\neriÅŸemeyeceksiniz. "; /*** Strings from TerminalWindow.m ***/ /* File: TerminalWindow.m:192 */ /* File: TerminalWindow.m:188 */ " (idle)" = " (etkin deÄŸil)"; /*** Strings from TerminalWindowPrefs.m ***/ /* File: TerminalWindowPrefs.m:192 */ "Add top and bottom border" = "Sınırları ekle"; /* File: TerminalWindowPrefs.m:143 */ "Close new windows when idle" = "Etkin olmayan yeni pencereleri kapat"; /* File: TerminalWindowPrefs.m:156 */ "Default size" = "Öntanımlı boyut"; /* File: TerminalWindowPrefs.m:144 */ "Don't close new windows" = "Yeni pencereleri kapatmayın"; /* File: TerminalWindowPrefs.m:169 */ "Height:" = "Yükseklik:"; /* File: TerminalWindowPrefs.m:112 */ "Terminal Window" = "Terminal Penceresi"; /* File: TerminalWindowPrefs.m:117 */ "Terminal\nWindow" = "Terminal\nPenceresi"; /* File: TerminalWindowPrefs.m:160 */ "Width:" = "GeniÅŸlik:"; /*** Strings from main.m ***/ /* File: main.m:157 */ "Benchmark" = "Donanım testi"; /* File: main.m:191 */ "Close" = "Kapat"; /* File: main.m:180 */ "Copy" = "Kopyala"; /* File: main.m:177 */ "Cut" = "Kes"; /* File: main.m:186 */ "Edit" = "Dzüenle"; /* File: main.m:203 */ "Hide" = "Gizle"; /* File: main.m:159 */ "Info" = "Bilgi"; /* File: main.m:153 */ "Info..." = "Bilgi..."; /* File: main.m:171 */ "New terminal" = "Yeni terminal"; /* File: main.m:183 */ "Paste" = "Yapıştır"; /* File: main.m:155 */ "Preferences..." = "Seçenekler..."; /* File: main.m:207 */ "Quit" = "Çık"; /* File: main.m:199 */ "Services" = "Hizmetler"; /* File: main.m:194 */ "Windows" = "Pencereler"; Terminal-0.9.8/Services.h0000644000175000001440000000157511016341203014477 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef Services_h #define Services_h #define Key @"Key" #define ReturnData @"ReturnData" #define Commandline @"Commandline" #define Input @"Input" #define Type @"Type" #define AcceptTypes @"AcceptTypes" #define INPUT_NO 0 #define INPUT_STDIN 1 #define INPUT_CMDLINE 2 #define ACCEPT_STRING 1 #define ACCEPT_FILENAMES 2 #define TYPE_BACKGROUND 0 #define TYPE_WINDOW_NEW 1 #define TYPE_WINDOW_IDLE 2 @interface TerminalServices : NSObject { } +(void) updateServicesPlist; +(NSDictionary *) terminalServicesDictionary; @end #endif Terminal-0.9.8/TerminalView.m0000644000175000001440000013545211725512651015347 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg forkpty replacement, 2005-2008 Riccardo Mottola This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ /* TODO: Move pty and child process handling to another class. Make this a stupid but fast character cell display view. */ /* define this if you need the forkpty replacement and it is not automatically activated */ #undef USE_FORKPTY_REPLACEMENT /* check for solaris */ #if defined (__SVR4) && defined (__sun) #define __SOLARIS__ 1 #define USE_FORKPTY_REPLACEMENT 1 #endif #include #include #ifdef __NetBSD__ # include # include # include # include #define TCSETS TIOCSETA #elif defined(__FreeBSD__) # include # include # include # include # include #elif defined(__OpenBSD__) # include # include # include #elif defined (__GNU__) #else # include #endif #include #include #include #include #ifndef __FreeBSD__ #if !(defined (__NetBSD__)) && !(defined (__SOLARIS__)) && !(defined(__OpenBSD__)) # include #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "TerminalView.h" #include "TerminalViewPrefs.h" /* forkpty replacement */ #ifdef USE_FORKPTY_REPLACEMENT #include /* for stderr and perror*/ #include /* for int errno */ #include #include #include #include #include #include #include #define PATH_TTY "/dev/tty" int ptyMakeControllingTty(int *slaveFd, const char *slaveName) { pid_t pgid; int fd; if (!slaveFd || *slaveFd < 0) { perror("slaveFd invalid"); return -1; } /* disconnect from the old controlling tty */ #ifdef TIOCNOTTY if ((fd = open(PATH_TTY, O_RDWR | O_NOCTTY)) >= 0 ) { ioctl(fd, TIOCNOTTY, NULL); close(fd); } #endif pgid = setsid(); /* create session and set process ID */ if (pgid == -1) { if (errno == EPERM) perror("EPERM error on setsid"); } /* Make it our controlling tty */ #ifdef TIOCSCTTY if (ioctl(*slaveFd, TIOCSCTTY, NULL) == -1) return -1; #else #warning TIOCSCTTY replacement { /* first terminal we open after setsid() is the controlling one */ char *controllingTty; int ctr_fdes; controllingTty = ttyname(*slaveFd); ctr_fdes = open(controllingTty, O_RDWR); close(ctr_fdes); } #endif /* TIOCSCTTY */ #if defined (TIOCSPGRP) ioctl (0, TIOCSPGRP, &pgid); #else #warning no TIOCSPGRP tcsetpgrp (0, pgid); #endif if ((fd = open(slaveName, O_RDWR)) >= 0) { close(*slaveFd); *slaveFd = fd; printf("Got new filedescriptor...\n"); } if ((fd = open(PATH_TTY, O_RDWR)) == -1) return -1; close(fd); return 0; } int openpty(int *amaster, int *aslave, char *name, const struct termios *termp, const struct winsize *winp) { int fdm, fds; char *slaveName; fdm = open("/dev/ptmx", O_RDWR); /* open master */ if (fdm == -1) { perror("openpty:open(master)"); return -1; } if(grantpt(fdm)) /* grant access to the slave */ { perror("openpty:grantpt(master)"); close(fdm); return -1; } if(unlockpt(fdm)) /* unlock the slave terminal */ { perror("openpty:unlockpt(master)"); close(fdm); return -1; } slaveName = ptsname(fdm); /* get name of the slave */ if (slaveName == NULL) { perror("openpty:ptsname(master)"); close(fdm); return -1; } if (name) /* of name ptr not null, copy it name back */ strcpy(name, slaveName); fds = open(slaveName, O_RDWR | O_NOCTTY); /* open slave */ if (fds == -1) { perror("openpty:open(slave)"); close (fdm); return -1; } /* ldterm and ttcompat are automatically pushed on the stack on some systems*/ #ifdef __SOLARIS__ if (ioctl(fds, I_PUSH, "ptem") == -1) /* pseudo terminal module */ { perror("openpty:ioctl(I_PUSH, ptem"); close(fdm); close(fds); return -1; } if (ioctl(fds, I_PUSH, "ldterm") == -1) /* ldterm must stay atop ptem */ { perror("forkpty:ioctl(I_PUSH, ldterm"); close(fdm); close(fds); return -1; } #endif /* set terminal parameters if present */ if (termp) ioctl(fds, TCSETS, termp); if (winp) ioctl(fds, TIOCSWINSZ, winp); *amaster = fdm; *aslave = fds; return 0; } int forkpty (int *amaster, char *slaveName, const struct termios *termp, const struct winsize *winp) { int fdm, fds; /* master and slave file descriptors */ pid_t pid; if (openpty(&fdm, &fds, slaveName, termp, winp) == -1) { perror("forkpty:openpty()"); return -1; } pid = fork(); if (pid == -1) { /* error */ perror("forkpty:fork()"); close(fdm); close(fds); return -1; } else if (pid == 0) { /* child */ ptyMakeControllingTty(&fds, slaveName); if (fds != STDIN_FILENO && dup2(fds, STDIN_FILENO) == -1) perror("error duplicationg stdin"); if (fds != STDOUT_FILENO && dup2(fds, STDOUT_FILENO) == -1) perror("error duplicationg stdout"); if (fds != STDERR_FILENO && dup2(fds, STDERR_FILENO) == -1) perror("error duplicationg stderr"); if (fds != STDIN_FILENO && fds != STDOUT_FILENO && fds != STDERR_FILENO) close(fds); close (fdm); } else { /* father */ close (fds); *amaster = fdm; } return pid; } #endif /* forpkty replacement */ /* TODO */ @interface NSView (unlockfocus) -(void) unlockFocusNeedsFlush: (BOOL)flush; @end NSString *TerminalViewBecameIdleNotification=@"TerminalViewBecameIdle", *TerminalViewBecameNonIdleNotification=@"TerminalViewBecameNonIdle", *TerminalViewTitleDidChangeNotification=@"TerminalViewTitleDidChange"; @interface TerminalView (scrolling) -(void) _updateScroller; -(void) _scrollTo: (int)new_scroll update: (BOOL)update; -(void) setScroller: (NSScroller *)sc; @end @interface TerminalView (selection) -(void) _clearSelection; @end @interface TerminalView (input) -(void) closeProgram; -(void) runShell; -(void) runProgram: (NSString *)path withArguments: (NSArray *)args initialInput: (NSString *)d; @end /** TerminalScreen protocol implementation and rendering methods **/ @implementation TerminalView (display) #define ADD_DIRTY(ax0,ay0,asx,asy) do { \ if (dirty.x0==-1) \ { \ dirty.x0=(ax0); \ dirty.y0=(ay0); \ dirty.x1=(ax0)+(asx); \ dirty.y1=(ay0)+(asy); \ } \ else \ { \ if (dirty.x0>(ax0)) dirty.x0=(ax0); \ if (dirty.y0>(ay0)) dirty.y0=(ay0); \ if (dirty.x1<(ax0)+(asx)) dirty.x1=(ax0)+(asx); \ if (dirty.y1<(ay0)+(asy)) dirty.y1=(ay0)+(asy); \ } \ } while (0) #define SCREEN(x,y) (screen[(y)*sx+(x)]) /* handle accumulated pending scrolls with a single composite */ -(void) _handlePendingScroll: (BOOL)lockFocus { float x0,y0,w,h,dx,dy; if (!pending_scroll) return; if (pending_scroll>=sy || pending_scroll<=-sy) { pending_scroll=0; return; } NSDebugLLog(@"draw",@"_handlePendingScroll %i %i",pending_scroll,lockFocus); dx=x0=0; w=fx*sx; if (pending_scroll>0) { y0=0; h=(sy-pending_scroll)*fy; dy=pending_scroll*fy; y0=sy*fy-y0-h; dy=sy*fy-dy-h; } else { pending_scroll=-pending_scroll; y0=pending_scroll*fy; h=(sy-pending_scroll)*fy; dy=0; y0=sy*fy-y0-h; dy=sy*fy-dy-h; } if (lockFocus) [self lockFocus]; DPScomposite(GSCurrentContext(),border_x+x0,border_y+y0,w,h, [self gState],border_x+dx,border_y+dy,NSCompositeCopy); if (lockFocus) [self unlockFocusNeedsFlush: NO]; num_scrolls++; pending_scroll=0; } static int total_draw=0; static const float col_h[8]={ 0,240,120,180, 0,300, 60, 0}; static const float col_s[8]={0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0}; static void set_background(NSGraphicsContext *gc, unsigned char color,unsigned char in) { float bh,bs,bb; int bg=color>>4; if (bg==0) bb=0.0; else if (bg>=8) bg-=8,bb=1.0; else bb=0.6; bs=col_s[bg]; bh=col_h[bg]/360.0; DPSsethsbcolor(gc,bh,bs,bb); } static void set_foreground(NSGraphicsContext *gc, unsigned char color,unsigned char in, BOOL blackOnWhite) { int fg=color; float h,s,b; if (blackOnWhite) { if (color == 0) { fg = 7; in = 2; } // Black becomes white else if (color == 7) { fg = 0; in = 0; } // White becomes black //else in = 3; // Other colors are saturated } if (fg>=8) { in++; fg-=8; } if (fg==0) { if (in==2) b=0.4; else b=0.0; } else if (in==0) b=0.6; else if (in==1) b=0.8; else b=1.0; h=col_h[fg]/360.0; s=col_s[fg]; if (in==2) s*=0.75; DPSsethsbcolor(gc,h,s,b); } -(void) drawRect: (NSRect)r { int ix,iy; char buf[8]; NSGraphicsContext *cur=GSCurrentContext(); int x0,y0,x1,y1; NSFont *f,*current_font=nil; int encoding; NSDebugLLog(@"draw",@"drawRect: (%g %g)+(%g %g) %i\n", r.origin.x,r.origin.y,r.size.width,r.size.height, draw_all); if (pending_scroll) [self _handlePendingScroll: NO]; /* draw the black border around the view if needed*/ { float a,b; DPSsetgray(cur,0.0); if (r.origin.xa) DPSrectfill(cur,a,r.origin.y,b-a,r.size.height); a=border_y+sy*fy; b=r.origin.y+r.size.height; if (b>a) DPSrectfill(cur,r.origin.x,a,r.size.width,b-a); } /* figure out what character cells might need redrawing */ r.origin.x-=border_x; r.origin.y-=border_y; x0=floor(r.origin.x/fx); x1=ceil((r.origin.x+r.size.width)/fx); if (x0<0) x0=0; if (x1>=sx) x1=sx; y1=floor(r.origin.y/fy); y0=ceil((r.origin.y+r.size.height)/fy); y0=sy-y0; y1=sy-y1; if (y0<0) y0=0; if (y1>=sy) y1=sy; NSDebugLLog(@"draw",@"dirty (%i %i)-(%i %i)\n",x0,y0,x1,y1); draw_cursor=draw_cursor || draw_all || (SCREEN(cursor_x,cursor_y).attr&0x80)!=0; { int ry; screen_char_t *ch; float scr_y,scr_x,start_x; /* setting the color is slow, so we try to avoid it */ unsigned char l_color,l_attr,color; /* Fill the background of dirty cells. Since the background doesn't change that often, runs of dirty cells with the same background color are combined and drawn with a single rectfill. */ l_color=0; l_attr=0; set_foreground(cur,l_color,l_attr,blackOnWhite); for (iy=y0;iy=0) ch=&SCREEN(x0,ry); else ch=&sbuf[x0+(max_scrollback+ry)*sx]; scr_y=(sy-1-iy)*fy+border_y; /* #define R(scr_x,scr_y,fx,fy) \ DPSgsave(cur); \ DPSsetgray(cur,0.0); \ DPSrectfill(cur,scr_x,scr_y,fx,fy); \ DPSgrestore(cur); \ DPSrectstroke(cur,scr_x,scr_y,fx,fy); \ */ /* ~400 cycles/cell on average */ #define R(scr_x,scr_y,fx,fy) DPSrectfill(cur,scr_x,scr_y,fx,fy) start_x=-1; for (ix=x0;ixattr&0x80)) { if (start_x!=-1) { scr_x=ix*fx+border_x; R(start_x,scr_y,scr_x-start_x,fy); start_x=-1; } continue; } scr_x=ix*fx+border_x; if (ch->attr&0x8) { color=ch->color&0xf; if (ch->attr&0x40) color^=0xf; if (color!=l_color || (ch->attr&0x03)!=l_attr) { if (start_x!=-1) { R(start_x,scr_y,scr_x-start_x,fy); start_x=scr_x; } l_color=color; l_attr=ch->attr&0x03; set_foreground(cur,l_color,l_attr,blackOnWhite); } } else { color=ch->color&0xf0; if (ch->attr&0x40) color^=0xf0; if (color!=l_color) { if (start_x!=-1) { R(start_x,scr_y,scr_x-start_x,fy); start_x=scr_x; } l_color=color; l_attr=ch->attr&0x03; set_background(cur,l_color,l_attr); } } if (start_x==-1) start_x=scr_x; } if (start_x!=-1) { scr_x=ix*fx+border_x; R(start_x,scr_y,scr_x-start_x,fy); } } /* now draw any dirty characters */ for (iy=y0;iy=0) ch=&SCREEN(x0,ry); else ch=&sbuf[x0+(max_scrollback+ry)*sx]; scr_y=(sy-1-iy)*fy+border_y; for (ix=x0;ixattr&0x80)) continue; ch->attr&=0x7f; scr_x=ix*fx+border_x; /* ~1700 cycles/change */ if (ch->attr&0x02 || (ch->ch!=0 && ch->ch!=32)) { if (!(ch->attr&0x8)) { color=ch->color&0xf; if (ch->attr&0x40) color^=0xf; if (color!=l_color || (ch->attr&0x03)!=l_attr) { l_color=color; l_attr=ch->attr&0x03; set_foreground(cur,l_color,l_attr,blackOnWhite); } } else { color=ch->color&0xf0; if (ch->attr&0x40) color^=0xf0; if (color!=l_color) { l_color=color; l_attr=ch->attr&0x03; set_background(cur,l_color,l_attr); } } } if (ch->ch!=0 && ch->ch!=32 && ch->ch!=MULTI_CELL_GLYPH) { total_draw++; if ((ch->attr&3)==2) { encoding=boldFont_encoding; f=boldFont; } else { encoding=font_encoding; f=font; } if (f!=current_font) { /* ~190 cycles/change */ [f set]; current_font=f; } /* we short-circuit utf8 for performance with back-art */ /* TODO: short-circuit latin1 too? */ if (encoding==NSUTF8StringEncoding) { unichar uch=ch->ch; if (uch>=0x800) { buf[2]=(uch&0x3f)|0x80; uch>>=6; buf[1]=(uch&0x3f)|0x80; uch>>=6; buf[0]=(uch&0x0f)|0xe0; buf[3]=0; } else if (uch>=0x80) { buf[1]=(uch&0x3f)|0x80; uch>>=6; buf[0]=(uch&0x1f)|0xc0; buf[2]=0; } else { buf[0]=uch; buf[1]=0; } } else { unichar uch=ch->ch; if (uch<=0x80) { buf[0]=uch; buf[1]=0; } else { unsigned char *pbuf=(unsigned char *)buf; unsigned int dlen=sizeof(buf)-1; GSFromUnicode(&pbuf,&dlen,&uch,1,encoding,NULL,GSUniTerminate); } } /* ~580 cycles */ DPSmoveto(cur,scr_x+fx0,scr_y+fy0); /* baseline here for mc-case 0.65 */ /* ~3800 cycles */ DPSshow(cur,buf); /* ~95 cycles to ARTGState -DPSshow:... */ /* ~343 cycles to isEmpty */ /* ~593 cycles to currentpoint */ /* ~688 cycles to transform */ /* ~1152 cycles to FTFont -drawString:... */ /* ~1375 cycles to -drawString:... setup */ /* ~1968 cycles cmap lookup */ /* ~2718 cycles sbit lookup */ /* ~~2750 cycles blit setup */ /* ~3140 cycles blit loop, empty call */ /* ~3140 cycles blit loop, setup */ /* ~3325 cycles blit loop, no write */ /* ~3800 cycles total */ } /* underline */ if (ch->attr&0x4) DPSrectfill(cur,scr_x,scr_y,fx,1); } } } if (draw_cursor) { float x,y; [[TerminalViewDisplayPrefs cursorColor] set]; x=cursor_x*fx+border_x; y=(sy-1-cursor_y+current_scroll)*fy+border_y; switch ([TerminalViewDisplayPrefs cursorStyle]) { case CURSOR_LINE: DPSrectfill(cur,x,y,fx,fy*0.1); break; case CURSOR_BLOCK_STROKE: DPSrectstroke(cur,x+0.5,y+0.5,fx-1.0,fy-1.0); break; case CURSOR_BLOCK_FILL: DPSrectfill(cur,x,y,fx,fy); break; case CURSOR_BLOCK_INVERT: DPScompositerect(cur,x,y,fx,fy, NSCompositeHighlight); break; } draw_cursor=NO; } NSDebugLLog(@"draw",@"total_draw=%i",total_draw); draw_all=1; } -(BOOL) isOpaque { return YES; } -(void) setNeedsDisplayInRect: (NSRect)r { draw_all=2; [super setNeedsDisplayInRect: r]; } -(void) setNeedsLazyDisplayInRect: (NSRect)r { if (draw_all==1) draw_all=0; [super setNeedsDisplayInRect: r]; } -(void) benchmark: (id)sender { int i; double t1,t2; NSRect r=[self frame]; t1=[NSDate timeIntervalSinceReferenceDate]; total_draw=0; for (i=0;i<100;i++) { draw_all=2; [self lockFocus]; [self drawRect: r]; [self unlockFocusNeedsFlush: NO]; } t2=[NSDate timeIntervalSinceReferenceDate]; t2-=t1; fprintf(stderr,"%8.4f %8.5f/redraw total_draw=%i\n",t2,t2/i,total_draw); } -(void) ts_setTitle: (NSString *)new_title type: (int)title_type { NSDebugLLog(@"ts",@"setTitle: %@ type: %i",new_title,title_type); if (title_type==1 || title_type==0) ASSIGN(title_miniwindow,new_title); if (title_type==2 || title_type==0) ASSIGN(title_window,new_title); [[NSNotificationCenter defaultCenter] postNotificationName: TerminalViewTitleDidChangeNotification object: self]; } -(void) ts_goto: (int)x:(int)y { NSDebugLLog(@"ts",@"goto: %i:%i",x,y); cursor_x=x; cursor_y=y; if (cursor_x>=sx) cursor_x=sx-1; if (cursor_x<0) cursor_x=0; if (cursor_y>=sy) cursor_y=sy-1; if (cursor_y<0) cursor_y=0; } -(void) ts_putChar: (screen_char_t)ch count: (int)c at: (int)x:(int)y { int i; screen_char_t *s; NSDebugLLog(@"ts",@"putChar: '%c' %02x %02x count: %i at: %i:%i", ch.ch,ch.color,ch.attr,c,x,y); if (y<0 || y>=sy) return; if (x+c>sx) c=sx-x; if (x<0) { c-=x; x=0; } s=&SCREEN(x,y); ch.attr|=0x80; for (i=0;isx*sy) c=sx*sy-ofs; if (ofs<0) { c-=ofs; ofs=0; } s=&SCREEN(ofs,0); ch.attr|=0x80; for (i=0;imax_scrollback) sb_length=max_scrollback; } if (t+nr >= b) nr = b - t - 1; if (b > sy || t >= b || nr < 1) return; d = &SCREEN(0,t); s = &SCREEN(0,t+nr); if (current_y>=t && current_y<=b) { SCREEN(current_x,current_y).attr|=0x80; draw_cursor=YES; /* TODO: does this properly handle the case when the cursor is in an area that gets scrolled 'over'? now it does, but not in an optimal way. handling of this could be optimized in all scrolling methods, but it probably won't make much difference */ } memmove(d, s, (b-t-nr) * sx * sizeof(screen_char_t)); if (!current_scroll) { if (t==0 && b==sy) { pending_scroll-=nr; } else { float x0,y0,w,h,dx,dy; if (pending_scroll) [self _handlePendingScroll: YES]; x0=0; w=fx*sx; y0=(t+nr)*fy; h=(b-t-nr)*fy; dx=0; dy=t*fy; y0=sy*fy-y0-h; dy=sy*fy-dy-h; [self lockFocus]; DPScomposite(GSCurrentContext(),border_x+x0,border_y+y0,w,h, [self gState],border_x+dx,border_y+dy,NSCompositeCopy); [self unlockFocusNeedsFlush: NO]; num_scrolls++; } } ADD_DIRTY(0,t,sx,b-t); } -(void) ts_scrollDown: (int)t:(int)b rows: (int)nr { screen_char_t *s; unsigned int step; NSDebugLLog(@"ts",@"scrollDown: %i:%i rows: %i", t,b,nr); if (t+nr >= b) nr = b - t - 1; if (b > sy || t >= b || nr < 1) return; s = &SCREEN(0,t); step = sx * nr; if (current_y>=t && current_y<=b) { SCREEN(current_x,current_y).attr|=0x80; draw_cursor=YES; } memmove(s + step, s, (b-t-nr)*sx*sizeof(screen_char_t)); if (!current_scroll) { if (t==0 && b==sy) { pending_scroll+=nr; } else { float x0,y0,w,h,dx,dy; if (pending_scroll) [self _handlePendingScroll: YES]; x0=0; w=fx*sx; y0=(t)*fy; h=(b-t-nr)*fy; dx=0; dy=(t+nr)*fy; y0=sy*fy-y0-h; dy=sy*fy-dy-h; [self lockFocus]; DPScomposite(GSCurrentContext(),border_x+x0,border_y+y0,w,h, [self gState],border_x+dx,border_y+dy,NSCompositeCopy); [self unlockFocusNeedsFlush: NO]; num_scrolls++; } } ADD_DIRTY(0,t,sx,b-t); } -(void) ts_shiftRow: (int)y at: (int)x0 delta: (int)delta { screen_char_t *s,*d; int x1,c; NSDebugLLog(@"ts",@"shiftRow: %i at: %i delta: %i", y,x0,delta); if (y<0 || y>=sy) return; if (x0<0 || x0>=sx) return; if (current_y==y) { SCREEN(current_x,current_y).attr|=0x80; draw_cursor=YES; } s=&SCREEN(x0,y); x1=x0+delta; c=sx-x0; if (x1<0) { x0-=x1; c+=x1; x1=0; } if (x1+c>sx) c=sx-x1; d=&SCREEN(x1,y); memmove(d,s,sizeof(screen_char_t)*c); if (!current_scroll) { float cx0,y0,w,h,dx,dy; if (pending_scroll) [self _handlePendingScroll: YES]; cx0=x0*fx; w=fx*c; dx=x1*fx; y0=y*fy; h=fy; dy=y0; y0=sy*fy-y0-h; dy=sy*fy-dy-h; [self lockFocus]; DPScomposite(GSCurrentContext(),border_x+cx0,border_y+y0,w,h, [self gState],border_x+dx,border_y+dy,NSCompositeCopy); [self unlockFocusNeedsFlush: NO]; num_scrolls++; } ADD_DIRTY(0,y,sx,1); } -(screen_char_t) ts_getCharAt: (int)x:(int)y { NSDebugLLog(@"ts",@"getCharAt: %i:%i",x,y); return SCREEN(x,y); } -(void) addDataToWriteBuffer: (const char *)data length: (int)len { if (!len) return; if (!write_buf_len) { [[NSRunLoop currentRunLoop] addEvent: (void *)(intptr_t)master_fd type: ET_WDESC watcher: self forMode: NSDefaultRunLoopMode]; } if (write_buf_len+len>write_buf_size) { /* Round up to nearest multiple of 512 bytes. */ write_buf_size=(write_buf_len+len+511)&~511; write_buf=realloc(write_buf,write_buf_size); } memcpy(&write_buf[write_buf_len],data,len); write_buf_len+=len; } -(void) ts_sendCString: (const char *)msg { [self ts_sendCString: msg length: strlen(msg)]; } -(void) ts_sendCString: (const char *)msg length: (int)len { int l; if (master_fd==-1) return; if (write_buf_len) { [self addDataToWriteBuffer: msg length: len]; return; } l=write(master_fd,msg,len); if (l!=len) { if (errno!=EAGAIN) NSLog(_(@"Unexpected error while writing: %m.")); if (l<0) l=0; [self addDataToWriteBuffer: &msg[l] length: len-l]; } } -(BOOL) useMultiCellGlyphs { return use_multi_cell_glyphs; } -(int) relativeWidthOfCharacter: (unichar)ch { int s; if (!use_multi_cell_glyphs) return 1; s=ceil([font boundingRectForGlyph: ch].size.width/fx); if (s<1) return 1; return s; } -(void) viewPrefsDidChange: (NSNotification *)n { /* TODO: handle font changes? */ [self setNeedsDisplay: YES]; } @end /** Scrolling **/ @implementation TerminalView (scrolling) -(void) _updateScroller { if (sb_length) { [scroller setEnabled: YES]; [scroller setFloatValue: (current_scroll+sb_length)/(float)(sb_length) knobProportion: sy/(float)(sy+sb_length)]; } else { [scroller setEnabled: NO]; } } -(void) _scrollTo: (int)new_scroll update: (BOOL)update { if (new_scroll>0) new_scroll=0; if (new_scroll<-sb_length) new_scroll=-sb_length; if (new_scroll==current_scroll) return; current_scroll=new_scroll; if (update) { [self _updateScroller]; } [self setNeedsDisplay: YES]; } -(void) scrollWheel: (NSEvent *)e { float delta=[e deltaY]; int new_scroll; int mult; if ([e modifierFlags]&NSShiftKeyMask) mult=1; else if ([e modifierFlags]&NSControlKeyMask) mult=sy; else mult=5; new_scroll=current_scroll-delta*mult; [self _scrollTo: new_scroll update: YES]; } -(void) _updateScroll: (id)sender { int new_scroll; int part=[scroller hitPart]; BOOL update=YES; if (part==NSScrollerKnob || part==NSScrollerKnobSlot) { float f=[scroller floatValue]; new_scroll=(f-1.0)*sb_length; update=NO; } else if (part==NSScrollerDecrementLine) new_scroll=current_scroll-1; else if (part==NSScrollerDecrementPage) new_scroll=current_scroll-sy/2; else if (part==NSScrollerIncrementLine) new_scroll=current_scroll+1; else if (part==NSScrollerIncrementPage) new_scroll=current_scroll+sy/2; else return; [self _scrollTo: new_scroll update: update]; } -(void) setScroller: (NSScroller *)sc { [scroller setTarget: nil]; ASSIGN(scroller,sc); [self _updateScroller]; [scroller setTarget: self]; [scroller setAction: @selector(_updateScroll:)]; } @end /** Keyboard events **/ @implementation TerminalView (keyboard) -(void) keyDown: (NSEvent *)e { NSString *s=[e charactersIgnoringModifiers]; NSDebugLLog(@"key",@"got key flags=%08x repeat=%i '%@' '%@' %4i %04x %i %04x %i\n", [e modifierFlags],[e isARepeat],[e characters],[e charactersIgnoringModifiers],[e keyCode], [[e characters] characterAtIndex: 0],[[e characters] length], [[e charactersIgnoringModifiers] characterAtIndex: 0],[[e charactersIgnoringModifiers] length]); if ([s length]==1 && ([e modifierFlags]&NSShiftKeyMask)) { unichar ch=[s characterAtIndex: 0]; if (ch==NSPageUpFunctionKey) { [self _scrollTo: current_scroll-sy+1 update: YES]; return; } if (ch==NSPageDownFunctionKey) { [self _scrollTo: current_scroll+sy-1 update: YES]; return; } } /* don't check until we get here so we handle scrollback page-up/down even when the view's idle */ if (master_fd==-1) return; [tp handleKeyEvent: e]; } -(BOOL) acceptsFirstResponder { return YES; } -(BOOL) becomeFirstResponder { return YES; } -(BOOL) resignFirstResponder { return YES; } @end /** Selection, copy/paste/services **/ @implementation TerminalView (selection) -(NSString *) _selectionAsString { int ofs=max_scrollback*sx; NSMutableString *mstr; NSString *tmp; unichar buf[32]; unichar ch; int len,ws_len; int i,j; if (selection.length==0) return nil; mstr=[[NSMutableString alloc] init]; j=selection.location+selection.length; len=0; for (i=selection.location;ij) { ws_len=0; /* make sure we break out of the outer loop */ break; } if (len) { tmp=[[NSString alloc] initWithCharacters: buf length: len]; [mstr appendString: tmp]; DESTROY(tmp); len=0; } [mstr appendString: @"\n"]; ws_len=0; continue; } } i-=ws_len; for (;i=j) break; buf[len++]=ch; if (len==32) { tmp=[[NSString alloc] initWithCharacters: buf length: 32]; [mstr appendString: tmp]; DESTROY(tmp); len=0; } } if (len) { tmp=[[NSString alloc] initWithCharacters: buf length: len]; [mstr appendString: tmp]; DESTROY(tmp); } return AUTORELEASE(mstr); } -(void) _setSelection: (struct selection_range)s { int i,j,ofs2; if (s.location<-sb_length*sx) { s.length+=sb_length*sx+s.location; s.location=-sb_length*sx; } if (s.location+s.length>sx*sy) { s.length=sx*sy-s.location; } if (!s.length && !selection.length) return; if (s.length==selection.length && s.location==selection.location) return; ofs2=max_scrollback*sx; j=selection.location+selection.length; if (j>s.location) j=s.location; for (i=selection.location;i=j;i--) { if (i<0) ch2=sbuf[ofs+i].ch; else ch2=screen[i].ch; if (ch2==0) ch2=' '; if (![cs characterIsMember: ch2]) break; } s.location=i+1; /* and forwards... */ j+=sx; for (i=pos+1;i=sx) p.x=sx-1; p.y=ceil((p.y-border_y)/fy); if (p.y<-1) p.y=-1; if (p.y>sy) p.y=sy; p.y=sy-p.y+current_scroll; ofs1=((int)p.x)+((int)p.y)*sx; r1=[self _selectionRangeAt: ofs1 granularity: g]; if (first) { ofs0=ofs1; first=0; r0=r1; } NSDebugLLog(@"select",@"ofs %i %i (%i+%i) (%i+%i)\n", ofs0,ofs1, r0.location,r0.length, r1.location,r1.length); if (ofs1>ofs0) { s.location=r0.location; s.length=r1.location+r1.length-r0.location; } else { s.location=r1.location; s.length=r0.location+r0.length-r1.location; } [self _setSelection: s]; [self displayIfNeeded]; e=[NSApp nextEventMatchingMask: NSLeftMouseDownMask|NSLeftMouseUpMask| NSLeftMouseDraggedMask|NSMouseMovedMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; } if (selection.length) { [self writeSelectionToPasteboard: [NSPasteboard pasteboardWithName: @"Selection"] types: [NSArray arrayWithObject: NSStringPboardType]]; } } -(void) otherMouseUp: (NSEvent *)e { NSPasteboard *pb=[NSPasteboard pasteboardWithName: @"Selection"]; NSString *type; NSString *str; type=[pb availableTypeFromArray: [NSArray arrayWithObject: NSStringPboardType]]; if (!type) return; str=[pb stringForType: NSStringPboardType]; if (str) [tp sendString: str]; } @end /** Handle master_fd **/ @implementation TerminalView (input) -(NSDate *) timedOutEvent: (void *)data type: (RunLoopEventType)t forMode: (NSString *)mode { NSLog(@"timedOutEvent:type:forMode: ignored"); return nil; } -(void) readData { char buf[256]; int size,total,i; // get_zombies(); total=0; num_scrolls=0; dirty.x0=-1; current_x=cursor_x; current_y=cursor_y; [self _clearSelection]; /* TODO? */ NSDebugLLog(@"term",@"receiving output"); while (1) { size=read(master_fd,buf,sizeof(buf)); if (size<0 && errno==EAGAIN) break; if (size<=0) { NSString *msg; int i,c; unichar ch; // get_zombies(); [self closeProgram]; msg=_(@"[Process exited]"); c=[msg length]; for (i=0;i=8192 || (num_scrolls+abs(pending_scroll))>10) break; } if (cursor_x!=current_x || cursor_y!=current_y) { ADD_DIRTY(current_x,current_y,1,1); SCREEN(current_x,current_y).attr|=0x80; ADD_DIRTY(cursor_x,cursor_y,1,1); draw_cursor=YES; } NSDebugLLog(@"term",@"done (%i %i) (%i %i)\n", dirty.x0,dirty.y0,dirty.x1,dirty.y1); if (dirty.x0>=0) { NSRect dr; // NSLog(@"dirty=(%i %i)-(%i %i)\n",dirty.x0,dirty.y0,dirty.x1,dirty.y1); dr.origin.x=dirty.x0*fx; dr.origin.y=dirty.y0*fy; dr.size.width=(dirty.x1-dirty.x0)*fx; dr.size.height=(dirty.y1-dirty.y0)*fy; dr.origin.y=fy*sy-(dr.origin.y+dr.size.height); // NSLog(@"-> dirty=(%g %g)+(%g %g)\n",dirty.origin.x,dirty.origin.y,dirty.size.width,dirty.size.height); dr.origin.x+=border_x; dr.origin.y+=border_y; [self setNeedsLazyDisplayInRect: dr]; if (current_scroll!=0) { /* TODO */ current_scroll=0; [self setNeedsDisplay: YES]; } [self _updateScroller]; } } -(void) writePendingData { int l,new_size; l=write(master_fd,write_buf,write_buf_len); if (l<0) { if (errno!=EAGAIN) NSLog(_(@"Unexpected error while writing: %m.")); return; } memmove(write_buf,&write_buf[l],write_buf_len-l); write_buf_len-=l; /* If less than half the buffer is empty, reallocate it, but never free it completely. */ new_size=(write_buf_len+511)&~511; if (!new_size) new_size=512; if (new_size<=write_buf_size/2) { write_buf_size=new_size; write_buf=realloc(write_buf,write_buf_size); } if (!write_buf_len) { [[NSRunLoop currentRunLoop] removeEvent: (void *)(intptr_t)master_fd type: ET_WDESC forMode: NSDefaultRunLoopMode all: YES]; } } -(void) receivedEvent: (void *)data type: (RunLoopEventType)type extra: (void *)extra forMode: (NSString *)mode { if (type==ET_WDESC) [self writePendingData]; else if (type==ET_RDESC) [self readData]; } -(void) closeProgram { if (master_fd==-1) return; NSDebugLLog(@"pty",@"closing master fd=%i\n",master_fd); [[NSRunLoop currentRunLoop] removeEvent: (void *)(intptr_t)master_fd type: ET_RDESC forMode: NSDefaultRunLoopMode all: YES]; [[NSRunLoop currentRunLoop] removeEvent: (void *)(intptr_t)master_fd type: ET_WDESC forMode: NSDefaultRunLoopMode all: YES]; write_buf_len=write_buf_size=0; free(write_buf); write_buf=NULL; close(master_fd); master_fd=-1; } -(void) runProgram: (NSString *)path withArguments: (NSArray *)args inDirectory: (NSString *)directory initialInput: (NSString *)d arg0: (NSString *)arg0 { int ret; struct winsize ws; NSRunLoop *rl; const char *cpath; const char *cargs[[args count]+2]; const char *cdirectory; int i; int pipefd[2]; int flags; NSDebugLLog(@"pty",@"-runProgram: %@ withArguments: %@ initialInput: %@", path,args,d); [self closeProgram]; cpath=[path cString]; if (arg0) cargs[0]=[arg0 cString]; else cargs[0]=cpath; cdirectory=[directory cString]; for (i=0;i<[args count];i++) { cargs[i+1]=[[args objectAtIndex: i] cString]; } cargs[i+1]=NULL; if (d) { if (pipe(pipefd)) { NSLog(_(@"Unable to open pipe for input: %m.")); return; } NSDebugLLog(@"pty",@"creating pipe for initial data, got %i %i", pipefd[0],pipefd[1]); } ws.ws_row=sy; ws.ws_col=sx; ret=forkpty(&master_fd,NULL,NULL,&ws); if (ret<0) { NSLog(_(@"Unable to fork: %m.")); return; } if (ret==0) { if (d) { close(pipefd[1]); dup2(pipefd[0],0); } if (cdirectory) if (chdir(cdirectory) < 0) fprintf(stderr, "Unable do set directory: %s\n", cdirectory); putenv("TERM=linux"); putenv("TERM_PROGRAM=GNUstep_Terminal"); execv(cpath,(char *const*)cargs); fprintf(stderr,"Unable to spawn process '%s': %m!",cpath); exit(1); } NSDebugLLog(@"pty",@"forked child %i, fd %i",ret,master_fd); /* Set non-blocking mode for the descriptor. */ flags=fcntl(master_fd,F_GETFL,0); if (flags==-1) { NSLog(_(@"Unable to set non-blocking mode: %m.")); } else { flags|=O_NONBLOCK; fcntl(master_fd,F_SETFL,flags); } rl=[NSRunLoop currentRunLoop]; [rl addEvent: (void *)master_fd type: ET_RDESC watcher: self forMode: NSDefaultRunLoopMode]; [[NSNotificationCenter defaultCenter] postNotificationName: TerminalViewBecameNonIdleNotification object: self]; if (d) { const char *s=[d UTF8String]; close(pipefd[0]); write(pipefd[1],s,strlen(s)); close(pipefd[1]); } DESTROY(title_window); if (args) title_window=[[NSString stringWithFormat: @"%@ %@", path,[args componentsJoinedByString: @" "]] retain]; else title_window=[path copy]; ASSIGN(title_miniwindow,path); [[NSNotificationCenter defaultCenter] postNotificationName: TerminalViewTitleDidChangeNotification object: self]; } -(void) runProgram: (NSString *)path withArguments: (NSArray *)args initialInput: (NSString *)d { [self runProgram: path withArguments: args inDirectory: nil initialInput: d arg0: path]; } -(void) runShell { NSString *arg0; NSString *path; path=[TerminalViewShellPrefs shell]; if ([TerminalViewShellPrefs loginShell]) arg0=[@"-" stringByAppendingString: path]; else arg0=path; [self runProgram: path withArguments: nil inDirectory: nil initialInput: nil arg0: arg0]; } @end /** drag'n'drop support **/ @implementation TerminalView (drag_n_drop) static int handled_mask= NSDragOperationCopy|NSDragOperationPrivate|NSDragOperationGeneric; -(unsigned int) draggingEntered: (id)sender { NSArray *types=[[sender draggingPasteboard] types]; unsigned int mask=[sender draggingSourceOperationMask]; NSDebugLLog(@"dragndrop",@"TerminalView draggingEntered mask=%x types=%@",mask,types); if (mask&handled_mask && ([types containsObject: NSFilenamesPboardType] || [types containsObject: NSStringPboardType])) return NSDragOperationCopy; return 0; } /* TODO: should I really have to implement this? */ -(BOOL) prepareForDragOperation: (id)sender { NSDebugLLog(@"dragndrop",@"preparing for drag"); return YES; } -(BOOL) performDragOperation: (id)sender { NSPasteboard *pb=[sender draggingPasteboard]; NSArray *types=[pb types]; unsigned int mask=[sender draggingSourceOperationMask]; NSDebugLLog(@"dragndrop",@"performDrag %x %@",mask,types); if (!(mask&handled_mask)) return NO; if ([types containsObject: NSFilenamesPboardType]) { NSArray *data; int i,c; data=[pb propertyListForType: NSFilenamesPboardType]; if (!data) data=[NSUnarchiver unarchiveObjectWithData: [pb dataForType: NSFilenamesPboardType]]; c=[data count]; for (i=0;insx) copy_sx=nsx; // NSLog(@"copy %i+%i %i (%ix%i)-(%ix%i)\n",start,num,copy_sx,sx,sy,nsx,nsy); /* TODO: handle resizing and scrollback improve? */ for (iy=-sb_length;iymax_scrollback) sb_length=max_scrollback; if (sb_length<0) sb_length=0; sx=nsx; sy=nsy; free(screen); free(sbuf); screen=nscreen; sbuf=nsbuf; if (cursor_x>sx) cursor_x=sx-1; if (cursor_y>sy) cursor_y=sy-1; [self _updateScroller]; [tp setTerminalScreenWidth: sx height: sy]; if (master_fd!=-1) { ws.ws_row=nsy; ws.ws_col=nsx; ioctl(master_fd,TIOCSWINSZ,&ws); } [self setNeedsDisplay: YES]; } -(void) setFrame: (NSRect)frame { [super setFrame: frame]; [self _resizeTerminalTo: frame.size]; } -(void) setFrameSize: (NSSize)size { [super setFrameSize: size]; [self _resizeTerminalTo: size]; } - initWithFrame: (NSRect)frame { sx=80; sy=25; if (!(self=[super initWithFrame: frame])) return nil; { NSSize s; NSRect r; font=[TerminalViewDisplayPrefs terminalFont]; [font retain]; boldFont=[TerminalViewDisplayPrefs boldTerminalFont]; [boldFont retain]; r=[font boundingRectForFont]; s=[TerminalView characterCellSize]; fx=s.width; fy=s.height; /* TODO: clear up font metrics issues with xlib/backart */ NSLog(@"NSFont %@ info %@ size %g %@ %d", font, [font fontInfo], [font pointSize], NSStringFromRect([font boundingRectForGlyph: 'A']), [font glyphIsEncoded: 'A']); fx0=-r.origin.x; fy0=-r.origin.y; NSDebugLLog(@"term",@"Bounding (%g %g)+(%g %g)",-fx0,-fy0,fx,fy); font_encoding=[font mostCompatibleStringEncoding]; boldFont_encoding=[boldFont mostCompatibleStringEncoding]; NSDebugLLog(@"term",@"encoding %i and %i", font_encoding,boldFont_encoding); } use_multi_cell_glyphs=[TerminalViewDisplayPrefs useMultiCellGlyphs]; blackOnWhite=[TerminalViewDisplayPrefs blackOnWhite]; screen=malloc(sizeof(screen_char_t)*sx*sy); memset(screen,0,sizeof(screen_char_t)*sx*sy); draw_all=2; max_scrollback=[TerminalViewDisplayPrefs scrollBackLines]; sbuf=malloc(sizeof(screen_char_t)*sx*max_scrollback); memset(sbuf,0,sizeof(screen_char_t)*sx*max_scrollback); tp=[[TerminalParser_Linux alloc] initWithTerminalScreen: self width: sx height: sy]; master_fd=-1; [self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType,NSStringPboardType,nil]]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(viewPrefsDidChange:) name: TerminalViewDisplayPrefsDidChangeNotification object: nil]; return self; } -(void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; [self closeProgram]; DESTROY(tp); [scroller setTarget: nil]; DESTROY(scroller); free(screen); free(sbuf); screen=NULL; sbuf=NULL; DESTROY(font); DESTROY(boldFont); DESTROY(title_window); DESTROY(title_miniwindow); [super dealloc]; } -(NSString *) windowTitle { return title_window; } -(NSString *) miniwindowTitle { return title_miniwindow; } -(void) setIgnoreResize: (BOOL)ignore { ignore_resize=ignore; } -(void) setBorder: (float)x : (float)y { border_x=x; border_y=y; } +(NSSize) characterCellSize { NSFont *f=[TerminalViewDisplayPrefs terminalFont]; NSSize s; s=[f boundingRectForFont].size; if ([TerminalViewDisplayPrefs useMultiCellGlyphs]) { s.width=[f boundingRectForGlyph: 'A'].size.width; } return s; } +(void) registerPasteboardTypes { NSArray *types=[NSArray arrayWithObject: NSStringPboardType]; [NSApp registerServicesMenuSendTypes: types returnTypes: nil]; } @end Terminal-0.9.8/TerminalParser_LinuxPrefs.h0000644000175000001440000000126011016341203020012 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef TerminalParser_LinuxPrefs_h #define TerminalParser_LinuxPrefs_h #include "PrefBox.h" @class GSVbox,NSPopUpButton; extern NSString *TerminalParser_LinuxPrefsDidChangeNotification; @interface TerminalParser_LinuxPrefs : NSObject { GSVbox *top; NSPopUpButton *pb_characterSet; } +(const char *) characterSet; @end #endif Terminal-0.9.8/Italian.lproj/0000755000175000001440000000000011667362252015264 5ustar multixusersTerminal-0.9.8/Italian.lproj/Localizable.strings~0000644000175000001440000002134111324143302021276 0ustar multixusers/*** Italian.lproj/Localizable.strings updated by make_strings 2010-01-15 20:49:22 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:654 */ "Command line:" = "Linea di Comando:"; /* File: TerminalView.m:1130 */ /* File: TerminalView.m:1857 */ /* Flag: untranslated */ "Unexpected error while writing: %m." = "Errore inatteso scrivendo: %m."; /* File: main.m:324 */ /* Flag: untranslated */ /* File: main.m:345 */ /* Flag: untranslated */ "Quit?" = "Uscire?"; /*** Unmatched/untranslated keys ***/ /* File: ServicesParameterWindowController.m:118 */ /* Flag: untranslated */ "Parameter for service %@" = "Parametro per il servizio %@"; /* File: TerminalView.m:1992 */ /* Flag: untranslated */ "Unable to set non-blocking mode: %m." = "Impossibile impostare modalità non bloccante: %m."; /* File: TerminalViewPrefs.m:289 */ /* Flag: unmatched */ "Line" = "Linea"; /* File: TerminalViewPrefs.m:290 */ /* Flag: unmatched */ "Stroked block" = "Blocco contornato"; /* File: TerminalViewPrefs.m:291 */ /* Flag: unmatched */ "Filled block" = "Blocco solido"; /* File: TerminalViewPrefs.m:292 */ /* Flag: unmatched */ "Inverted block" = "Blocco invertito"; /* File: TerminalViewPrefs.m:397 */ /* Flag: untranslated */ "Display black on white text" = "Mostra testo bianco su nero"; /* File: main.m:189 */ /* Flag: untranslated */ "Miniaturize all" = "Cintrai tutte"; /* File: main.m:275 */ /* Flag: untranslated */ "Quit anyway" = "Esci comunque"; /* File: main.m:283 */ /* Flag: untranslated */ "Don't quit" = "Non uscire."; /* File: main.m:300 */ /* Flag: untranslated */ "There are active windows. Quitting will close them." = "Ci sono finestre attive, verranno chiuse in uscita."; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:95 */ "Apply and save" = "Applica e salva"; /* File: PreferencesWindowController.m:140 */ "Preferences" = "Preferenze"; /* File: PreferencesWindowController.m:87 */ "Revert" = "Ripristina"; /*** Strings from Services.m ***/ /* File: Services.m:151 */ "Service aborted by user." = "Servizio interrotto dall'utente."; /* File: Services.m:59 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "Servizio '%@' non esistente.\nL'elenco dei servizi è probabilmente non aggiornato.\nLanciare il comando 'make_services' per aggiornarlo."; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Annulla"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:586 */ "Accept types" = "Tipi accettati"; /* File: ServicesPrefs.m:500 */ "Add" = "Aggiungi"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Errore di importazione dei servizi"; /* File: ServicesPrefs.m:401 */ "Export services" = "Esporta servizi"; /* File: ServicesPrefs.m:524 */ "Export..." = "Esporta..."; /* File: ServicesPrefs.m:595 */ "Filenames" = "Archivi:"; /* File: ServicesPrefs.m:550 */ "Ignore output" = "Ignora output"; /* File: ServicesPrefs.m:254 */ "Import services" = "Importa servizi"; /* File: ServicesPrefs.m:516 */ "Import..." = "Importa..."; /* File: ServicesPrefs.m:560 */ "Input in stdin" = "Input nello stdin"; /* File: ServicesPrefs.m:561 */ "Input on command line" = "Input dalla linea di comando"; /* File: ServicesPrefs.m:641 */ "Key:" = "Chiave:"; /* File: ServicesPrefs.m:628 */ "Name:" = "Nome:"; /* File: ServicesPrefs.m:559 */ "No input" = "Nessun input"; /* File: ServicesPrefs.m:603 */ "Plain text" = "Testo semplice"; /* File: ServicesPrefs.m:508 */ "Remove" = "Rimuovi"; /* File: ServicesPrefs.m:551 */ "Return output" = "Output di ritorno"; /* File: ServicesPrefs.m:569 */ "Run in background" = "Esegui in background"; /* File: ServicesPrefs.m:571 */ "Run in idle window" = "Esegui nella finestra inattiva"; /* File: ServicesPrefs.m:570 */ "Run in new window" = "Esegui in una nuova finestra"; /* File: ServicesPrefs.m:469 */ "Terminal services" = "Servizi di terminale"; /* File: ServicesPrefs.m:474 */ "Terminal\nservices" = "Servizi\ndi terminale"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "Il file '%@' non contiene servizi di terminale validi."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "Servizio senza nome"; /*** Strings from TerminalParser_LinuxPrefs.m ***/ /* File: TerminalParser_LinuxPrefs.m:104 */ "'linux' terminal parser" = "'linux' analizzatore di terminale"; /* File: TerminalParser_LinuxPrefs.m:109 */ "'linux'\nparser" = "'linux'\nanalizzatore"; /* File: TerminalParser_LinuxPrefs.m:152 */ "Character set:" = "Codifica caratteri:"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Chinese" = "Cinese"; /* File: TerminalParser_LinuxPrefs.m:45 */ "Custom, leave unchanged" = "Personalizzata, non modificata"; /* File: TerminalParser_LinuxPrefs.m:43 */ "East Europe, latin2" = "Est Europa, latin2"; /* File: TerminalParser_LinuxPrefs.m:41 */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:42 */ "West Europe, latin1" = "Ovest Europa , latin1"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1965 */ "Unable to fork: %m." = "Fork non riuscita: %m."; /* File: TerminalView.m:1953 */ "Unable to open pipe for input: %m." = "Pipe non disponibile per input: %m."; /* File: TerminalView.m:1765 */ "[Process exited]" = "[Processo terminato]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:408 */ "Bold font:" = "Grassetto :"; /* File: TerminalViewPrefs.m:367 */ "Color:" = "Colore:"; /* File: TerminalViewPrefs.m:322 */ "Cursor" = "Cursore"; /* File: TerminalViewPrefs.m:273 */ /* File: TerminalViewPrefs.m:268 */ "Display" = "Display"; /* File: TerminalViewPrefs.m:390 */ "Handle wide (multi-cell) glyphs" = "Gestisci gligi ampi (cella multipla)"; /* File: TerminalViewPrefs.m:690 */ /* File: TerminalViewPrefs.m:685 */ "Keyboard" = "Tastiera"; /* File: TerminalViewPrefs.m:435 */ "Normal font:" = "Carattere normale:"; /* File: TerminalViewPrefs.m:447 */ /* File: TerminalViewPrefs.m:420 */ "Pick font..." = "Scegli carattere..."; /* File: TerminalViewPrefs.m:299 */ "Scroll-back length in lines:" = "Lunghezza scorrimento in linee:"; /* File: TerminalViewPrefs.m:730 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "Invia un doppio escape per il tasto escape.\n\nSignifica che il carattere di escape sarà\nriconosciuto piu velocemente da molti programmi, ma\n non si può usare come sostituto di meta."; /* File: TerminalViewPrefs.m:577 */ /* File: TerminalViewPrefs.m:572 */ "Shell" = "Shell"; /* File: TerminalViewPrefs.m:610 */ "Shell:" = "Shell:"; /* File: TerminalViewPrefs.m:598 */ "Start as login-shell" = "Inizio come shell di login"; /* File: TerminalViewPrefs.m:327 */ "Style:" = "Stile:"; /* File: TerminalViewPrefs.m:715 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Tratta il tasto comando come meta.\n\nNota che con questo abilitato,\nnon potrai accedere ai menu con la\ntastiera."; /*** Strings from TerminalWindow.m ***/ /* File: TerminalWindow.m:203 */ /* File: TerminalWindow.m:199 */ " (idle)" = " (inattivo)"; /*** Strings from TerminalWindowPrefs.m ***/ /* File: TerminalWindowPrefs.m:212 */ "Add top and bottom border" = "Aggiungi bordo in alto e in basso"; /* File: TerminalWindowPrefs.m:152 */ "Close new windows when idle" = "Chiudi le nuove finestre quando non utilizzate"; /* File: TerminalWindowPrefs.m:176 */ "Default size" = "Dimensione di default"; /* File: TerminalWindowPrefs.m:153 */ "Don't close new windows" = "Non chiudere le nuove finestre"; /* File: TerminalWindowPrefs.m:189 */ "Height:" = "Altezza:"; /* File: TerminalWindowPrefs.m:114 */ "Terminal Window" = "Finestra Terminale"; /* File: TerminalWindowPrefs.m:119 */ "Terminal\nWindow" = "Finestra\nTerminale"; /* File: TerminalWindowPrefs.m:180 */ "Width:" = "Larghezza:"; /*** Strings from main.m ***/ /* File: main.m:152 */ "Benchmark" = "Benchmark"; /* File: main.m:186 */ "Close" = "Chiudi"; /* File: main.m:175 */ "Copy" = "Copia"; /* File: main.m:172 */ "Cut" = "Taglia"; /* File: main.m:181 */ "Edit" = "Composizione"; /* File: main.m:201 */ "Hide" = "Nascondi"; /* File: main.m:154 */ "Info" = "Informazioni"; /* File: main.m:148 */ "Info..." = "Informazioni..."; /* File: main.m:166 */ "New terminal" = "Nuovo terminale"; /* File: main.m:178 */ "Paste" = "Incolla"; /* File: main.m:150 */ "Preferences..." = "Preferenze..."; /* File: main.m:205 */ "Quit" = "Esci"; /* File: main.m:197 */ "Services" = "Servizi"; /* File: main.m:192 */ "Windows" = "Finestre"; Terminal-0.9.8/Italian.lproj/Localizable.strings0000644000175000001440000002135411324161724021114 0ustar multixusers/*** Italian.lproj/Localizable.strings updated by make_strings 2010-01-15 20:49:22 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:654 */ "Command line:" = "Linea di Comando:"; /* File: TerminalView.m:1130 */ /* File: TerminalView.m:1857 */ /* Flag: untranslated */ "Unexpected error while writing: %m." = "Errore inatteso scrivendo: %m."; /* File: main.m:324 */ /* Flag: untranslated */ /* File: main.m:345 */ /* Flag: untranslated */ "Quit?" = "Uscire?"; /*** Unmatched/untranslated keys ***/ /* File: ServicesParameterWindowController.m:118 */ /* Flag: untranslated */ "Parameter for service %@" = "Parametro per il servizio %@"; /* File: TerminalView.m:1992 */ /* Flag: untranslated */ "Unable to set non-blocking mode: %m." = "Impossibile impostare modalit\U00E0 non bloccante: %m."; /* File: TerminalViewPrefs.m:289 */ /* Flag: unmatched */ "Line" = "Linea"; /* File: TerminalViewPrefs.m:290 */ /* Flag: unmatched */ "Stroked block" = "Blocco contornato"; /* File: TerminalViewPrefs.m:291 */ /* Flag: unmatched */ "Filled block" = "Blocco solido"; /* File: TerminalViewPrefs.m:292 */ /* Flag: unmatched */ "Inverted block" = "Blocco invertito"; /* File: TerminalViewPrefs.m:397 */ /* Flag: untranslated */ "Display black on white text" = "Mostra testo bianco su nero"; /* File: main.m:189 */ /* Flag: untranslated */ "Miniaturize all" = "Contrai tutte"; /* File: main.m:275 */ /* Flag: untranslated */ "Quit anyway" = "Esci comunque"; /* File: main.m:283 */ /* Flag: untranslated */ "Don't quit" = "Non uscire."; /* File: main.m:300 */ /* Flag: untranslated */ "There are active windows. Quitting will close them." = "Ci sono finestre attive, verranno chiuse in uscita."; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:95 */ "Apply and save" = "Applica e salva"; /* File: PreferencesWindowController.m:140 */ "Preferences" = "Preferenze"; /* File: PreferencesWindowController.m:87 */ "Revert" = "Ripristina"; /*** Strings from Services.m ***/ /* File: Services.m:151 */ "Service aborted by user." = "Servizio interrotto dall'utente."; /* File: Services.m:59 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "Servizio '%@' non esistente.\nL'elenco dei servizi \U00E8 probabilmente non aggiornato.\nLanciare il comando 'make_services' per aggiornarlo."; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Annulla"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:586 */ "Accept types" = "Tipi accettati"; /* File: ServicesPrefs.m:500 */ "Add" = "Aggiungi"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Errore di importazione dei servizi"; /* File: ServicesPrefs.m:401 */ "Export services" = "Esporta servizi"; /* File: ServicesPrefs.m:524 */ "Export..." = "Esporta..."; /* File: ServicesPrefs.m:595 */ "Filenames" = "Archivi:"; /* File: ServicesPrefs.m:550 */ "Ignore output" = "Ignora output"; /* File: ServicesPrefs.m:254 */ "Import services" = "Importa servizi"; /* File: ServicesPrefs.m:516 */ "Import..." = "Importa..."; /* File: ServicesPrefs.m:560 */ "Input in stdin" = "Input nello stdin"; /* File: ServicesPrefs.m:561 */ "Input on command line" = "Input dalla linea di comando"; /* File: ServicesPrefs.m:641 */ "Key:" = "Chiave:"; /* File: ServicesPrefs.m:628 */ "Name:" = "Nome:"; /* File: ServicesPrefs.m:559 */ "No input" = "Nessun input"; /* File: ServicesPrefs.m:603 */ "Plain text" = "Testo semplice"; /* File: ServicesPrefs.m:508 */ "Remove" = "Rimuovi"; /* File: ServicesPrefs.m:551 */ "Return output" = "Output di ritorno"; /* File: ServicesPrefs.m:569 */ "Run in background" = "Esegui in background"; /* File: ServicesPrefs.m:571 */ "Run in idle window" = "Esegui nella finestra inattiva"; /* File: ServicesPrefs.m:570 */ "Run in new window" = "Esegui in una nuova finestra"; /* File: ServicesPrefs.m:469 */ "Terminal services" = "Servizi di terminale"; /* File: ServicesPrefs.m:474 */ "Terminal\nservices" = "Servizi\ndi terminale"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "Il file '%@' non contiene servizi di terminale validi."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "Servizio senza nome"; /*** Strings from TerminalParser_LinuxPrefs.m ***/ /* File: TerminalParser_LinuxPrefs.m:104 */ "'linux' terminal parser" = "Interprete di terminale 'linux'"; /* File: TerminalParser_LinuxPrefs.m:109 */ "'linux'\nparser" = "Interprete\n'linux'"; /* File: TerminalParser_LinuxPrefs.m:152 */ "Character set:" = "Codifica caratteri:"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Chinese" = "Cinese"; /* File: TerminalParser_LinuxPrefs.m:45 */ "Custom, leave unchanged" = "Personalizzata, non modificata"; /* File: TerminalParser_LinuxPrefs.m:43 */ "East Europe, latin2" = "Est Europa, latin2"; /* File: TerminalParser_LinuxPrefs.m:41 */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:42 */ "West Europe, latin1" = "Ovest Europa , latin1"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1965 */ "Unable to fork: %m." = "Fork non riuscita: %m."; /* File: TerminalView.m:1953 */ "Unable to open pipe for input: %m." = "Pipe non disponibile per input: %m."; /* File: TerminalView.m:1765 */ "[Process exited]" = "[Processo terminato]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:408 */ "Bold font:" = "Grassetto :"; /* File: TerminalViewPrefs.m:367 */ "Color:" = "Colore:"; /* File: TerminalViewPrefs.m:322 */ "Cursor" = "Cursore"; /* File: TerminalViewPrefs.m:273 */ /* File: TerminalViewPrefs.m:268 */ "Display" = "Display"; /* File: TerminalViewPrefs.m:390 */ "Handle wide (multi-cell) glyphs" = "Gestisci glifi ampi (cella multipla)"; /* File: TerminalViewPrefs.m:690 */ /* File: TerminalViewPrefs.m:685 */ "Keyboard" = "Tastiera"; /* File: TerminalViewPrefs.m:435 */ "Normal font:" = "Carattere normale:"; /* File: TerminalViewPrefs.m:447 */ /* File: TerminalViewPrefs.m:420 */ "Pick font..." = "Scegli carattere..."; /* File: TerminalViewPrefs.m:299 */ "Scroll-back length in lines:" = "Lunghezza scorrimento in linee:"; /* File: TerminalViewPrefs.m:730 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "Invia un doppio escape per il tasto escape.\n\nSignifica che il carattere di escape sar\U00E0\nriconosciuto piu velocemente da molti programmi, ma\nnon si pu\U00F2 usare come sostituto di meta."; /* File: TerminalViewPrefs.m:577 */ /* File: TerminalViewPrefs.m:572 */ "Shell" = "Shell"; /* File: TerminalViewPrefs.m:610 */ "Shell:" = "Shell:"; /* File: TerminalViewPrefs.m:598 */ "Start as login-shell" = "Inizio come shell di login"; /* File: TerminalViewPrefs.m:327 */ "Style:" = "Stile:"; /* File: TerminalViewPrefs.m:715 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Tratta il tasto comando come meta.\n\nNota che con questo abilitato,\nnon potrai accedere ai menu con la\ntastiera."; /*** Strings from TerminalWindow.m ***/ /* File: TerminalWindow.m:203 */ /* File: TerminalWindow.m:199 */ " (idle)" = " (inattivo)"; /*** Strings from TerminalWindowPrefs.m ***/ /* File: TerminalWindowPrefs.m:212 */ "Add top and bottom border" = "Aggiungi bordo in alto e in basso"; /* File: TerminalWindowPrefs.m:152 */ "Close new windows when idle" = "Chiudi le nuove finestre quando non utilizzate"; /* File: TerminalWindowPrefs.m:176 */ "Default size" = "Dimensione di default"; /* File: TerminalWindowPrefs.m:153 */ "Don't close new windows" = "Non chiudere le nuove finestre"; /* File: TerminalWindowPrefs.m:189 */ "Height:" = "Altezza:"; /* File: TerminalWindowPrefs.m:114 */ "Terminal Window" = "Finestra Terminale"; /* File: TerminalWindowPrefs.m:119 */ "Terminal\nWindow" = "Finestra\nTerminale"; /* File: TerminalWindowPrefs.m:180 */ "Width:" = "Larghezza:"; /*** Strings from main.m ***/ /* File: main.m:152 */ "Benchmark" = "Benchmark"; /* File: main.m:186 */ "Close" = "Chiudi"; /* File: main.m:175 */ "Copy" = "Copia"; /* File: main.m:172 */ "Cut" = "Taglia"; /* File: main.m:181 */ "Edit" = "Composizione"; /* File: main.m:201 */ "Hide" = "Nascondi"; /* File: main.m:154 */ "Info" = "Informazioni"; /* File: main.m:148 */ "Info..." = "Informazioni..."; /* File: main.m:166 */ "New terminal" = "Nuovo terminale"; /* File: main.m:178 */ "Paste" = "Incolla"; /* File: main.m:150 */ "Preferences..." = "Preferenze..."; /* File: main.m:205 */ "Quit" = "Esci"; /* File: main.m:197 */ "Services" = "Servizi"; /* File: main.m:192 */ "Windows" = "Finestre"; Terminal-0.9.8/TerminalWindow.m0000644000175000001440000001347311016341203015664 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #include #include #include #include #include #include #include #include #include #include #include #include "TerminalWindow.h" #include "TerminalWindowPrefs.h" #include "TerminalView.h" /* TODO: this needs cleaning up. chances are this will interfere with NSTask */ static void get_zombies(void) { int status,pid; while ((pid=waitpid(-1,&status,WNOHANG))>0) { // printf("got %i\n",pid); } } static int num_instances; NSString *TerminalWindowNoMoreActiveWindowsNotification= @"TerminalWindowNoMoreActiveWindowsNotification"; @implementation TerminalWindowController - init { NSWindow *win; NSScroller *scroller; GSHbox *hb; float fx,fy; int scroller_width; NSRect contentRect,windowRect; NSSize contentSize,minSize; int sx,sy; { NSSize size=[TerminalView characterCellSize]; fx=size.width; fy=size.height; } sx=[TerminalWindowPrefs defaultWindowWidth]; sy=[TerminalWindowPrefs defaultWindowHeight]; scroller_width=[NSScroller scrollerWidth]; // calc the rects for our window contentSize = NSMakeSize (fx * sx + scroller_width + 1, fy * sy + 1); minSize = NSMakeSize (fx * 20 + scroller_width + 1, fy * 4 + 1); // add the borders to the size contentSize.width += 8; minSize.width += 8; if ([TerminalWindowPrefs addYBorders]) { contentSize.height += 8; minSize.height += 8; } contentRect = NSMakeRect (100, 100, contentSize.width, contentSize.height); win=[[NSWindow alloc] initWithContentRect: contentRect styleMask: NSClosableWindowMask|NSTitledWindowMask|NSResizableWindowMask|NSMiniaturizableWindowMask backing: NSBackingStoreRetained defer: YES]; if (!(self=[super initWithWindow: win])) return nil; num_instances++; windowRect = [win frame]; minSize.width += windowRect.size.width - contentSize.width; minSize.height += windowRect.size.height - contentSize.height; [win setTitle: @"Terminal"]; [win setDelegate: self]; [win setContentSize: contentSize]; [win setResizeIncrements: NSMakeSize (fx , fy)]; [win setMinSize: minSize]; hb=[[GSHbox alloc] init]; scroller=[[NSScroller alloc] initWithFrame: NSMakeRect(0,0,[NSScroller scrollerWidth],fy)]; [scroller setArrowsPosition: NSScrollerArrowsMaxEnd]; [scroller setEnabled: YES]; [scroller setAutoresizingMask: NSViewHeightSizable]; [hb addView: scroller enablingXResizing: NO]; [scroller release]; tv=[[TerminalView alloc] init]; [tv setIgnoreResize: YES]; [tv setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable]; [tv setScroller: scroller]; [hb addView: tv]; [tv release]; [win makeFirstResponder: tv]; [tv setIgnoreResize: NO]; if ([TerminalWindowPrefs addYBorders]) [tv setBorder: 4 : 4]; else [tv setBorder: 4 : 0]; [win setContentView: hb]; DESTROY(hb); [win release]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_becameIdle) name: TerminalViewBecameIdleNotification object: tv]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_becameNonIdle) name: TerminalViewBecameNonIdleNotification object: tv]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_updateTitle:) name: TerminalViewTitleDidChangeNotification object: tv]; return self; } -(void) _updateTitle: (NSNotification *)n { [[self window] setTitle: [tv windowTitle]]; [[self window] setMiniwindowTitle: [tv miniwindowTitle]]; } -(void) dealloc { num_instances--; [isa checkActiveWindows]; [[NSNotificationCenter defaultCenter] removeObserver: self]; [super dealloc]; } static NSMutableArray *idle_list; -(void) windowWillClose: (NSNotification *)n { get_zombies(); [idle_list removeObject: self]; [self autorelease]; } -(void) _becameIdle { NSDebugLLog(@"idle",@"%@ _becameIdle",self); if (close_on_idle) { [self close]; return; } [idle_list addObject: self]; NSDebugLLog(@"idle",@"idle list: %@",idle_list); { NSString *t; t=[[self window] title]; t=[t stringByAppendingString: _(@" (idle)")]; [[self window] setTitle: t]; t=[[self window] miniwindowTitle]; t=[t stringByAppendingString: _(@" (idle)")]; [[self window] setMiniwindowTitle: t]; } [isa checkActiveWindows]; } -(void) _becameNonIdle { NSDebugLLog(@"idle",@"%@ _becameNonIdle",self); [idle_list removeObject: self]; NSDebugLLog(@"idle",@"idle list: %@",idle_list); } -(TerminalView *) terminalView { return tv; } -(void) setShouldCloseWhenIdle: (BOOL)should { close_on_idle=should; } +(void) initialize { if (!idle_list) idle_list=[[NSMutableArray alloc] init]; } +(TerminalWindowController *) newTerminalWindow { TerminalWindowController *twc; twc=[[self alloc] init]; if ([TerminalWindowPrefs windowCloseBehavior]==0) [twc setShouldCloseWhenIdle: YES]; [twc showWindow: self]; return twc; } +(TerminalWindowController *) idleTerminalWindow { TerminalWindowController *new; NSDebugLLog(@"idle",@"get idle window from idle list: %@",idle_list); if ([idle_list count]) return [idle_list objectAtIndex: 0]; new=[[self alloc] init]; [new showWindow: self]; return new; } +(int) numberOfActiveWindows { return num_instances-[idle_list count]; } +(void) checkActiveWindows { if (![self numberOfActiveWindows]) { [[NSNotificationCenter defaultCenter] postNotificationName: TerminalWindowNoMoreActiveWindowsNotification object: self]; } } @end Terminal-0.9.8/Terminal.tiff0000644000175000001440000002233211561216225015174 0ustar multixusersMM* Ð Ð þ00Ú0$(Rüýÿÿûüÿÿÿýÿÿþýÿÿýÿÿÿýÿÿÿûýÿÿûýÿÿüûÿÿûúüÿùøüÿø÷ùÿöõùÿóòôÿïîòÿíìðÿéèìÿåäèÿàßãÿÜÛßÿÙØÜÿÓÒÖÿÌËÏÿÇÆÊÿÀ¿Ãÿ»º¾ÿ´³·ÿ¯®²ÿ©¨¬ÿ¢¡¥ÿœ›Ÿÿ—–šÿ’‘•ÿŒÿˆ‡‹ÿ…„ˆÿƒ‚†ÿ~}ÿ{z~ÿzy}ÿtvyÿsuxÿrtwÿprsÿtswÿsrvÿpruÿpqwÿýüÿÿñðòÿñðòÿñðòÿòñóÿðïñÿòñóÿñðòÿòñóÿðððÿïîðÿîîîÿíìîÿìììÿëêìÿêéëÿèçéÿçæèÿåäæÿãâäÿáàâÿÞÝßÿÜÛÝÿÚÙÛÿØ×ÙÿÖÕ×ÿÒÑÓÿÑÐÒÿÏÎÐÿÎÍÏÿÍÌÎÿÊÉËÿÈÇÉÿÉÈÊÿÇÆÈÿÅÄÆÿÄÃÅÿÄÃÅÿÄÃÅÿÃÂÄÿÄÃÅÿÂÂÂÿÅÅÅÿÃÃÃÿÁÀÂÿÄÃÅÿ¾½¿ÿposÿÿþÿÿóòôÿñññÿòòòÿñññÿóóóÿñññÿðððÿïïïÿïïïÿïïïÿïïïÿîîîÿíííÿëëëÿêêêÿçççÿæææÿåååÿãããÿáááÿßßßÿÜÛÝÿÚÙÛÿØØØÿÖÖÖÿÓÓÓÿÑÑÑÿÎÎÎÿÌÌÌÿÌÌÌÿÊÊÊÿÈÈÈÿÆÆÆÿÅÅÅÿÅÅÅÿÆÆÆÿÅÅÅÿÄÄÄÿÃÃÃÿÃÃÃÿÂÂÂÿÂÂÀÿÄÄÂÿÃÃÃÿÃÃÃÿÀÀÀÿonpÿýüÿÿóòôÿðððÿòòòÿðððÿðððÿòñóÿóòôÿñññÿðððÿïïïÿîîîÿíííÿìììÿëëëÿêêêÿéééÿçççÿäääÿâââÿáááÿßßßÿÜÜÜÿÙÙÙÿ×××ÿÕÕÕÿÒÒÒÿÑÑÑÿÐÐÐÿÎÎÎÿÍÍÍÿÊÊÊÿÈÈÈÿÉÉÉÿÇÇÇÿÄÄÄÿÃÃÃÿÄÄÄÿÄÄÄÿÃÃÃÿÂÁÃÿÅÅÅÿÃÃÁÿÂÂÀÿÃÃÃÿÃÃÃÿ¿¿¿ÿpoqÿþýÿÿôóõÿqqqÿqqqÿrrrÿnnnÿhgiÿ^]_ÿTSUÿJIKÿ<;?ÿ/.0ÿ%$(ÿÿÿÿÿÿ!ÿ #ÿ #ÿ"ÿ ÿÿÿÿÿÿ ÿ"ÿ #ÿ!ÿ ÿÿÿÿ"ÿ(')ÿ76:ÿEDFÿYXZÿhgiÿyyyÿ………ÿŒ‹ÿÿ¿¿¿ÿnmoÿûúþÿóòôÿœœœÿšššÿÿ›››ÿ ÿ ÿ ÿ ÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿ ÿÿ ÿ ÿ ÿ ÿ ÿßááÿÛÝÝÿâáãÿßßßÿ½¿¿ÿmopÿûúüÿóóóÿšššÿÿšššÿœžÿ ÿÿûÿÿÿûÿÿÿûÿÿÿûÿÿÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ ÿÜÞßÿßááÿßÞàÿáááÿ½¿¿ÿlnoÿùøúÿóóóÿÿ™™™ÿžžžÿš™›ÿ ÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00AÿŽë¾ÿ00Aÿ QÿQqqÿŽë¾ÿŽÛ®ÿ QÿŽë¾ÿAŠaÿ00AÿŽë¾ÿ00AÿŽë¾ÿ00Aÿ QÿŽë¾ÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ ÿáàâÿÝÝÝÿáááÿÞÞÞÿ¿¿¿ÿmlnÿöõ÷ÿôôòÿšššÿÿšššÿœžÿ ÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Qÿ00QÿŽë¾ÿ00AÿŽë¾ÿ00Qÿ00Qÿ00QÿŽë¾ÿŽÛ®ÿQqqÿŽë¾ÿ00QÿŽÛ®ÿ00Qÿ00QÿŽÛ®ÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ ÿÝÜÞÿáááÿÞÞÞÿâââÿ¾¾¾ÿlkmÿôóõÿóóñÿœœœÿ™™™ÿžžžÿš™›ÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Aÿ00QÿŽë¾ÿ00AÿŽë¾ÿ00QÿŽÛ®ÿ00QÿŽë¾ÿQqqÿŽÛ®ÿŽë¾ÿ00QÿŽÛ®ÿ00Aÿ QÿŽÛ®ÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ ÿáàâÿÝÝÝÿáááÿÞÞÞÿ¿¿¿ÿlkmÿñðòÿòòðÿšššÿžžžÿšššÿœ›ÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00QÿŽë¾ÿ00Aÿ QÿQqqÿŽë¾ÿQqqÿ QÿŽë¾ÿ QÿAŠaÿŽë¾ÿ00AÿQqqÿŽÛ®ÿŽÛ®ÿQqqÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Aÿ00Qÿ00Qÿ00QÿÿÞÝáÿáááÿÞÞÞÿâââÿ¿¿¿ÿhgiÿìëíÿóóóÿœœœÿ™™™ÿžžžÿ›šœÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00AÿÿâáåÿÞÞÞÿáááÿÞÞÞÿ¾¾¾ÿihjÿçæèÿóóóÿšššÿÿ™™™ÿœžÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00QÿÿÞÝáÿáááÿÝÝÝÿâââÿ¿¿¿ÿedfÿáàâÿòòòÿÿ™™™ÿžžžÿš™›ÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00AÿÿâáåÿÞÞÞÿáááÿÞÞÞÿ¿¿¿ÿdceÿÝÜÞÿóóóÿšššÿÿšššÿœžÿÿÿûÿÿÿ®ª®ÿ®ª®ÿÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Aÿ00Qÿ00Qÿ00QÿÿÞÝáÿáááÿÞÞÞÿâââÿ¾¾¾ÿbaeÿÕÔÖÿôôôÿšššÿÿ›››ÿœžÿÿÿûÿÿ®ª®ÿÿûÿÿ®ª®ÿÿ00AÿŽë¾ÿ00Aÿ QÿQqqÿŽë¾ÿŽÛ®ÿ QÿŽë¾ÿAŠaÿ00AÿŽë¾ÿ00AÿŽë¾ÿ00Aÿ QÿŽë¾ÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00AÿÿÞÝáÿáááÿÞÞÞÿáááÿ¿¿¿ÿ^]aÿÍÌÐÿñññÿÿšššÿÿ›šœÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Qÿ00QÿŽë¾ÿ00AÿŽë¾ÿ00Qÿ00Qÿ00QÿŽë¾ÿŽÛ®ÿQqqÿŽë¾ÿ00QÿŽÛ®ÿ00Qÿ00QÿŽÛ®ÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00QÿÿàßãÿÞÞÞÿáááÿÞÞÞÿÀÀÀÿ[Z^ÿÅÄÈÿóóóÿ›››ÿÿšššÿœžÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Aÿ00QÿŽë¾ÿ00AÿŽë¾ÿ00QÿŽÛ®ÿ00QÿŽë¾ÿQqqÿŽÛ®ÿŽë¾ÿ00QÿŽÛ®ÿ00Aÿ QÿŽÛ®ÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00AÿÿÞÝáÿáááÿÞÞÞÿáááÿ¾¾¾ÿXW[ÿ¾½Áÿóóóÿœœœÿ™™™ÿÿœ›ÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00QÿŽë¾ÿ00Aÿ QÿQqqÿŽë¾ÿQqqÿ QÿŽë¾ÿ QÿAŠaÿŽë¾ÿ00AÿQqqÿŽÛ®ÿŽÛ®ÿQqqÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00QÿÿàßáÿßßßÿáááÿßßßÿÀÀÀÿTSUÿµ´¸ÿóóóÿ›šœÿ›šœÿœœœÿœžÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00AÿÿßÞàÿßßßÿßßßÿàààÿ¿¿¿ÿPOQÿ­¬°ÿóóóÿœžÿš™›ÿÿš™›ÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00QÿÿáàâÿÞÞÞÿáááÿßßßÿÀÀÀÿLKMÿ¦¥©ÿóóóÿœžÿ›šœÿœœœÿš™›ÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ ÿàßáÿÞÞÞÿáááÿßßßÿ¿¿¿ÿHGIÿž¡ÿòòòÿš™›ÿœžÿšššÿœ ÿ ÿÿÿÿÿÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00QÿÿÞÝßÿàààÿßßßÿáááÿ¾¾¾ÿFEIÿ—–šÿóóóÿœœœÿšššÿœžžÿ˜šÿÿÿûÿÿÿûÿÿÿûÿÿÿûÿÿÿ00AÿŽë¾ÿ00Aÿ QÿQqqÿŽë¾ÿŽÛ®ÿ QÿŽë¾ÿAŠaÿ00AÿŽë¾ÿ00AÿŽë¾ÿ00Aÿ QÿŽë¾ÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ ÿáàâÿÞÞÜÿááßÿÞÞÜÿÀÀÀÿA@Dÿ“ÿóóóÿ™™™ÿžžžÿ—™™ÿ› ÿ ÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Qÿ00QÿŽë¾ÿ00AÿŽë¾ÿ00Qÿ00Qÿ00QÿŽë¾ÿŽÛ®ÿQqqÿŽë¾ÿ00QÿŽÛ®ÿ00Qÿ00QÿŽÛ®ÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ ÿÞÝßÿââàÿÝÝÛÿááßÿ¾¾¾ÿ?>Bÿ‰ˆŒÿòòòÿÿ™™™ÿœžžÿ™›žÿ ÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Aÿ00QÿŽë¾ÿ00AÿŽë¾ÿ00QÿŽÛ®ÿ00QÿŽë¾ÿQqqÿŽÛ®ÿŽë¾ÿ00QÿŽÛ®ÿ00Aÿ QÿŽÛ®ÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ ÿàßáÿÝÝÛÿââàÿßßÝÿ¾¾¾ÿ<;?ÿ…„ˆÿóóóÿ›››ÿÿ˜ššÿ› ÿ ÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00QÿŽë¾ÿ00Aÿ QÿQqqÿŽë¾ÿQqqÿ QÿŽë¾ÿ QÿAŠaÿŽë¾ÿ00AÿQqqÿŽÛ®ÿŽÛ®ÿQqqÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ ÿÞÝßÿááßÿÞÞÜÿááßÿ¿¿¿ÿ98<ÿ€ƒÿóóóÿœœœÿ™™™ÿžžžÿ›šžÿ ÿÿÿÿÿÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ ÿàßáÿÝÝÝÿâââÿßßßÿ¾¾¾ÿ76:ÿ|{}ÿóóóÿšššÿžžžÿ™™™ÿœžÿÿÿûÿÿÿûÿÿÿûÿÿÿûÿÿÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ00Qÿ ÿßÞàÿáááÿÝÝÝÿáááÿ¿¿¿ÿ548ÿyxzÿòòòÿœžÿš™›ÿžžžÿš™›ÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ ÿáàâÿÝÝÝÿâââÿÞÞÞÿÀÀÀÿ326ÿvuwÿóóóÿš™›ÿžŸÿ™™™ÿžŸÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ00Aÿ00Qÿ00Aÿ00Qÿ00Qÿ00Qÿ ÿÞÝßÿáááÿÞÞÞÿáááÿ¿¿¿ÿ215ÿutvÿóóóÿœžÿš™›ÿžžžÿ›šœÿÿÿûÿÿ®ª®ÿ®ª®ÿ®ª®ÿÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ Qÿ00Aÿ ÿàßáÿÞÞÞÿâââÿÝÝÝÿÀÀÀÿ215ÿrqsÿòòòÿš™›ÿœžÿšššÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿ ÿÿ ÿ ÿ ÿ ÿ ÿßÞàÿáááÿÞÞÞÿâââÿ¿¿¿ÿ/.2ÿrqsÿôôôÿþýÿÿÿþÿÿþþþÿþþþÿýüÿÿúùýÿùøúÿõôöÿñðòÿìëíÿæåçÿßßßÿØØØÿÔÔÔÿÌËÍÿÇÆÊÿÁÀÄÿ½¼Àÿº¸¿ÿ·¶ºÿ¶µ¹ÿµ´¸ÿ´³·ÿ³²¶ÿµ´¸ÿ·µ¼ÿº¸¿ÿ¾½ÁÿÃÂÆÿÇÆÈÿÎÍÏÿÓÒÖÿÙ×ÞÿßÝäÿæåéÿìëïÿòñóÿõôöÿöøùÿúüýÿýýýÿýýýÿýüþÿàßáÿ¾¾¾ÿ/.2ÿrqsÿòòòÿñðòÿñðòÿòòòÿñññÿñðòÿóòôÿðððÿïïíÿîîîÿîîîÿîîîÿííëÿêêèÿééçÿéééÿæææÿäãåÿãâäÿâáãÿßÞàÿÜÜÜÿÙÙÙÿÙÙÙÿÖÖÖÿÓÓÓÿÒÒÒÿÏÎÐÿÍÍÍÿËËËÿÊÊÊÿÇÇÇÿÇÇÇÿÇÆÈÿÅÄÆÿÄÃÅÿÄÃÅÿÄÄÄÿÃÃÃÿÁÃÃÿÁÃÄÿÂÂÂÿÃÃÃÿÄÃÅÿÂÁÃÿÀÀÀÿ/.2ÿqstÿñóóÿóòôÿïîðÿñññÿñññÿðïñÿðïñÿðððÿïïïÿïïïÿïïïÿîîîÿíííÿëëëÿêêêÿèèèÿçççÿäãåÿâáãÿáàâÿßßßÿÝÝÛÿÚÚØÿ××ÕÿÕÕÓÿÓÓÑÿÑÑÏÿÏÏÏÿÎÎÌÿÌÌÊÿÊÊÈÿÉÉÇÿÉÉÉÿÇÇÇÿÅÄÆÿÄÃÅÿÅÄÆÿÄÄÄÿÃÃÃÿÄÄÄÿÃÃÃÿÄÄÄÿÂÂÂÿÄÁÄÿÅÂÅÿ¿¿¿ÿ.-/ÿqstÿðòòÿïîòÿóòôÿðððÿññïÿòòòÿñðòÿðððÿðððÿïïïÿîîîÿíìîÿìëíÿêêêÿêêêÿçççÿçççÿæææÿãâäÿáàâÿßßßÿÜÜÚÿÙÙÕÿÙÙ×ÿÖÖÔÿÓÓÑÿÐÐÎÿÎÎÎÿÍÍËÿÌÌÊÿÊÊÈÿÉÉÇÿÈÈÆÿÇÇÇÿÅÅÅÿÄÃÅÿÄÃÅÿÄÄÄÿÃÃÃÿÃÃÃÿÁÁÁÿÂÂÂÿÃÃÃÿÄÁÄÿÄÂÃÿÀÀÀÿ/.0ÿHJKÿñóóÿòñõÿðïñÿòòòÿòòðÿðððÿòòòÿðððÿðððÿïïïÿîîîÿîíïÿìëíÿëëëÿêêêÿèèæÿççåÿåååÿãâäÿáàâÿßÞàÿÜÜÜÿÚÚØÿØØØÿÕÕÕÿÓÓÓÿÒÒÒÿÏÎÐÿÎÎÎÿÌÌÌÿÊÊÊÿÈÈÈÿÇÇÇÿÆÆÄÿÅÅÃÿÄÄÄÿÄÄÄÿÄÄÄÿÄÄÄÿÃÃÁÿÄÄÂÿÄÄÄÿÃÃÃÿÃÀÃÿÄÂÃÿ¿¿¿ÿ0/1ÿnpsÿmorÿnlsÿposÿonpÿnnnÿpppÿmmmÿmmmÿlllÿkkkÿjjjÿihjÿhgiÿfffÿeeeÿccaÿaa_ÿ___ÿ]]]ÿ[Z\ÿWVXÿTTTÿRRPÿPPPÿLLLÿIHJÿGFHÿDCEÿAAAÿ???ÿ===ÿ;;;ÿ999ÿ775ÿ664ÿ555ÿ444ÿ222ÿ111ÿ111ÿ---ÿ/.0ÿ/.0ÿ0/3ÿ/.2ÿ0/1ÿ/-4ÿÜÞáÿœžžÿ¯²¯ÿ°²²ÿ°²²ÿ°²²ÿ¯±±ÿ­¯°ÿ¬®¯ÿ¬¬¬ÿ©©©ÿ¥¥¥ÿ   ÿœœœÿ———ÿŽŽŽÿ†††ÿ€€~ÿuusÿlljÿbbbÿ\Y\ÿPOQÿGGGÿ@@@ÿ666ÿ102ÿ+*,ÿ#%&ÿ###ÿÿÿÿÿÿÿÿ ÿàáçÿ»¿¿ÿ°´³ÿ°²²ÿ°²²ÿ±³´ÿ®°±ÿ­¯°ÿ­¯°ÿ­­­ÿ©©©ÿ¥¥¥ÿŸŸŸÿÿ–––ÿÿ‡‡‡ÿÿvvtÿmmkÿbb`ÿZXYÿRPQÿIIGÿ>><ÿ867ÿ201ÿ+*,ÿ"$%ÿ"""ÿÿÿÿÿÿÿ ÿÿàáçÿFHKÿJIMÿIHJÿKJNÿKJLÿJIKÿIIIÿFEGÿIIIÿFFFÿFFDÿDBCÿ@>?ÿ@>?ÿ<:;ÿ867ÿ867ÿ201ÿ1/.ÿ-+*ÿ*('ÿ%%#ÿ$$"ÿ#!ÿ ÿÿÿÿÿÿÿÿ ÿÿÿFEIÿHGIÿFEGÿFHIÿEEEÿFFDÿDDDÿIIIÿFDEÿJHIÿ.,-ÿ&#&ÿ&#&ÿ%#$ÿ,*)ÿ$$"ÿ''%ÿ$$"ÿ--)ÿ$$ ÿ%%!ÿ%%#ÿÿÿÿÿECJÿFHKÿNRRÿGFHÿEEEÿFIFÿNQNÿGGEÿFDCÿ331ÿ$$$ÿ%$(ÿ('+ÿ333ÿ'''ÿ%$&ÿ(')ÿ331ÿ%%#ÿÿÿÿÿÿ’––ÿšššÿOOOÿCFCÿGJGÿFFDÿ$$"ÿ%%#ÿ$&&ÿ,+/ÿ$#'ÿ#%%ÿÿÿÿÿÿÿ‘’˜ÿ¯±²ÿ±³´ÿ²±µÿ±°´ÿ°¯³ÿ°¯±ÿ¯­®ÿªªªÿ©««ÿ¢¤¤ÿ¡¡Ÿÿ›šÿ———ÿ’’’ÿ‹‹‹ÿ†††ÿ|||ÿtsuÿmlnÿdddÿ^^^ÿTTRÿNLMÿEEEÿ This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ #ifndef ServicesPrefs_h #define ServicesPrefs_h #include "PrefBox.h" @class NSMutableDictionary,NSMutableArray; @class GSVbox,NSTableView,NSPopUpButton,NSTextField; @interface TerminalServicesPrefs : NSObject { NSMutableDictionary *services; NSMutableArray *service_list; int current; GSVbox *top; NSTableView *list; NSPopUpButton *pb_input,*pb_output,*pb_type; NSTextField *tf_name,*tf_cmdline,*tf_key; NSButton *cb_string,*cb_filenames; } @end #endif Terminal-0.9.8/.#TerminalView.m.1.50000644000175000001440000013430511127244106015757 0ustar multixusers/* copyright 2002, 2003 Alexander Malmberg forkpty replacement, 2005-2008 Riccardo Mottola This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ /* TODO: Move pty and child process handling to another class. Make this a stupid but fast character cell display view. */ /* define this if you need the forkpty replacement and it is not automatically activated */ #undef USE_FORKPTY_REPLACEMENT #define USE_FORKPTY_REPLACEMENT 1 /* check for solaris */ #if defined (__SVR4) && defined (__sun) #define __SOLARIS__ 1 #define USE_FORKPTY_REPLACEMENT 1 #endif #include #include #ifdef __NetBSD__ # include # include # include # include #define TCSETS TIOCSETA #else #ifdef freebsd # include # include # include # include # include #else # include #endif #endif #include #include #include #include #ifndef freebsd #if !(defined (__NetBSD__)) && !(defined (__SOLARIS__)) # include #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "TerminalView.h" #include "TerminalViewPrefs.h" /* forkpty replacement */ #ifdef USE_FORKPTY_REPLACEMENT #include /* for stderr and perror*/ #include /* for int errno */ #include #include #include #include #include #include #include #define PATH_TTY "/dev/tty" int ptyMakeControllingTty(int *slaveFd, const char *slaveName) { pid_t pgid; int fd; if (!slaveFd || *slaveFd < 0) { perror("slaveFd invalid"); return -1; } /* disconnect from the old controlling tty */ #ifdef TIOCNOTTY if ((fd = open(PATH_TTY, O_RDWR | O_NOCTTY)) >= 0 ) { ioctl(fd, TIOCNOTTY, NULL); close(fd); } #endif pgid = setsid(); /* create session and set process ID */ if (pgid == -1) { if (errno == EPERM) perror("EPERM error on setsid"); } /* Make it our controlling tty */ #ifdef TIOCSCTTY if (ioctl(*slaveFd, TIOCSCTTY, NULL) == -1) return -1; #else #warning TIOCSCTTY replacement { /* first terminal we open after setsid() is the controlling one */ char *controllingTty; int ctr_fdes; controllingTty = ttyname(*slaveFd); ctr_fdes = open(controllingTty, O_RDWR); close(ctr_fdes); } #endif /* TIOCSCTTY */ #if defined (TIOCSPGRP) ioctl (0, TIOCSPGRP, &pgid); #else #warning no TIOCSPGRP tcsetpgrp (0, pgid); #endif if ((fd = open(slaveName, O_RDWR)) >= 0) { close(*slaveFd); *slaveFd = fd; printf("Got new filedescriptor...\n"); } if ((fd = open(PATH_TTY, O_RDWR)) == -1) return -1; close(fd); return 0; } int openpty(int *amaster, int *aslave, char *name, const struct termios *termp, const struct winsize *winp) { int fdm, fds; char *slaveName; fdm = open("/dev/ptmx", O_RDWR); /* open master */ if (fdm == -1) { perror("openpty:open(master)"); return -1; } if(grantpt(fdm)) /* grant access to the slave */ { perror("openpty:grantpt(master)"); close(fdm); return -1; } if(unlockpt(fdm)) /* unlock the slave terminal */ { perror("openpty:unlockpt(master)"); close(fdm); return -1; } slaveName = ptsname(fdm); /* get name of the slave */ if (slaveName == NULL) { perror("openpty:ptsname(master)"); close(fdm); return -1; } if (name) /* of name ptr not null, copy it name back */ strcpy(name, slaveName); fds = open(slaveName, O_RDWR | O_NOCTTY); /* open slave */ if (fds == -1) { perror("openpty:open(slave)"); close (fdm); return -1; } /* ldterm and ttcompat are automatically pushed on the stack on some systems*/ #ifdef __SOLARIS__ if (ioctl(fds, I_PUSH, "ptem") == -1) /* pseudo terminal module */ { perror("openpty:ioctl(I_PUSH, ptem"); close(fdm); close(fds); return -1; } if (ioctl(fds, I_PUSH, "ldterm") == -1) /* ldterm must stay atop ptem */ { perror("forkpty:ioctl(I_PUSH, ldterm"); close(fdm); close(fds); return -1; } #endif /* set terminal parameters if present */ if (termp) ioctl(fds, TCSETS, termp); if (winp) ioctl(fds, TIOCSWINSZ, winp); *amaster = fdm; *aslave = fds; return 0; } int forkpty (int *amaster, char *slaveName, const struct termios *termp, const struct winsize *winp) { int fdm, fds; /* master and slave file descriptors */ pid_t pid; if (openpty(&fdm, &fds, slaveName, termp, winp) == -1) { perror("forkpty:openpty()"); return -1; } pid = fork(); if (pid == -1) { /* error */ perror("forkpty:fork()"); close(fdm); close(fds); return -1; } else if (pid == 0) { /* child */ ptyMakeControllingTty(&fds, slaveName); if (fds != STDIN_FILENO && dup2(fds, STDIN_FILENO) == -1) perror("error duplicationg stdin"); if (fds != STDOUT_FILENO && dup2(fds, STDOUT_FILENO) == -1) perror("error duplicationg stdout"); if (fds != STDERR_FILENO && dup2(fds, STDERR_FILENO) == -1) perror("error duplicationg stderr"); if (fds != STDIN_FILENO && fds != STDOUT_FILENO && fds != STDERR_FILENO) close(fds); close (fdm); } else { /* father */ close (fds); *amaster = fdm; } return pid; } #endif /* forpkty replacement */ /* TODO */ @interface NSView (unlockfocus) -(void) unlockFocusNeedsFlush: (BOOL)flush; @end NSString *TerminalViewBecameIdleNotification=@"TerminalViewBecameIdle", *TerminalViewBecameNonIdleNotification=@"TerminalViewBecameNonIdle", *TerminalViewTitleDidChangeNotification=@"TerminalViewTitleDidChange"; @interface TerminalView (scrolling) -(void) _updateScroller; -(void) _scrollTo: (int)new_scroll update: (BOOL)update; -(void) setScroller: (NSScroller *)sc; @end @interface TerminalView (selection) -(void) _clearSelection; @end @interface TerminalView (input) -(void) closeProgram; -(void) runShell; -(void) runProgram: (NSString *)path withArguments: (NSArray *)args initialInput: (NSString *)d; @end /** TerminalScreen protocol implementation and rendering methods **/ @implementation TerminalView (display) #define ADD_DIRTY(ax0,ay0,asx,asy) do { \ if (dirty.x0==-1) \ { \ dirty.x0=(ax0); \ dirty.y0=(ay0); \ dirty.x1=(ax0)+(asx); \ dirty.y1=(ay0)+(asy); \ } \ else \ { \ if (dirty.x0>(ax0)) dirty.x0=(ax0); \ if (dirty.y0>(ay0)) dirty.y0=(ay0); \ if (dirty.x1<(ax0)+(asx)) dirty.x1=(ax0)+(asx); \ if (dirty.y1<(ay0)+(asy)) dirty.y1=(ay0)+(asy); \ } \ } while (0) #define SCREEN(x,y) (screen[(y)*sx+(x)]) /* handle accumulated pending scrolls with a single composite */ -(void) _handlePendingScroll: (BOOL)lockFocus { float x0,y0,w,h,dx,dy; if (!pending_scroll) return; if (pending_scroll>=sy || pending_scroll<=-sy) { pending_scroll=0; return; } NSDebugLLog(@"draw",@"_handlePendingScroll %i %i",pending_scroll,lockFocus); dx=x0=0; w=fx*sx; if (pending_scroll>0) { y0=0; h=(sy-pending_scroll)*fy; dy=pending_scroll*fy; y0=sy*fy-y0-h; dy=sy*fy-dy-h; } else { pending_scroll=-pending_scroll; y0=pending_scroll*fy; h=(sy-pending_scroll)*fy; dy=0; y0=sy*fy-y0-h; dy=sy*fy-dy-h; } if (lockFocus) [self lockFocus]; DPScomposite(GSCurrentContext(),border_x+x0,border_y+y0,w,h, [self gState],border_x+dx,border_y+dy,NSCompositeCopy); if (lockFocus) [self unlockFocusNeedsFlush: NO]; num_scrolls++; pending_scroll=0; } static int total_draw=0; static const float col_h[8]={ 0,240,120,180, 0,300, 60, 0}; static const float col_s[8]={0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0}; static void set_background(NSGraphicsContext *gc, unsigned char color,unsigned char in) { float bh,bs,bb; int bg=color>>4; if (bg==0) bb=0.0; else if (bg>=8) bg-=8,bb=1.0; else bb=0.6; bs=col_s[bg]; bh=col_h[bg]/360.0; DPSsethsbcolor(gc,bh,bs,bb); } static void set_foreground(NSGraphicsContext *gc, unsigned char color,unsigned char in) { int fg=color; float h,s,b; if (fg>=8) { in++; fg-=8; } if (fg==0) { if (in==2) b=0.4; else b=0.0; } else if (in==0) b=0.6; else if (in==1) b=0.8; else b=1.0; h=col_h[fg]/360.0; s=col_s[fg]; if (in==2) s*=0.75; DPSsethsbcolor(gc,h,s,b); } -(void) drawRect: (NSRect)r { int ix,iy; unsigned char buf[8]; NSGraphicsContext *cur=GSCurrentContext(); int x0,y0,x1,y1; NSFont *f,*current_font=nil; int encoding; NSDebugLLog(@"draw",@"drawRect: (%g %g)+(%g %g) %i\n", r.origin.x,r.origin.y,r.size.width,r.size.height, draw_all); if (pending_scroll) [self _handlePendingScroll: NO]; /* draw the black border around the view if needed*/ { float a,b; DPSsetgray(cur,0.0); if (r.origin.xa) DPSrectfill(cur,a,r.origin.y,b-a,r.size.height); a=border_y+sy*fy; b=r.origin.y+r.size.height; if (b>a) DPSrectfill(cur,r.origin.x,a,r.size.width,b-a); } /* figure out what character cells might need redrawing */ r.origin.x-=border_x; r.origin.y-=border_y; x0=floor(r.origin.x/fx); x1=ceil((r.origin.x+r.size.width)/fx); if (x0<0) x0=0; if (x1>=sx) x1=sx; y1=floor(r.origin.y/fy); y0=ceil((r.origin.y+r.size.height)/fy); y0=sy-y0; y1=sy-y1; if (y0<0) y0=0; if (y1>=sy) y1=sy; NSDebugLLog(@"draw",@"dirty (%i %i)-(%i %i)\n",x0,y0,x1,y1); draw_cursor=draw_cursor || draw_all || (SCREEN(cursor_x,cursor_y).attr&0x80)!=0; { int ry; screen_char_t *ch; float scr_y,scr_x,start_x; /* setting the color is slow, so we try to avoid it */ unsigned char l_color,l_attr,color; /* Fill the background of dirty cells. Since the background doesn't change that often, runs of dirty cells with the same background color are combined and drawn with a single rectfill. */ l_color=0; l_attr=0; set_foreground(cur,l_color,l_attr); for (iy=y0;iy=0) ch=&SCREEN(x0,ry); else ch=&sbuf[x0+(max_scrollback+ry)*sx]; scr_y=(sy-1-iy)*fy+border_y; /* #define R(scr_x,scr_y,fx,fy) \ DPSgsave(cur); \ DPSsetgray(cur,0.0); \ DPSrectfill(cur,scr_x,scr_y,fx,fy); \ DPSgrestore(cur); \ DPSrectstroke(cur,scr_x,scr_y,fx,fy); \ */ /* ~400 cycles/cell on average */ #define R(scr_x,scr_y,fx,fy) DPSrectfill(cur,scr_x,scr_y,fx,fy) start_x=-1; for (ix=x0;ixattr&0x80)) { if (start_x!=-1) { scr_x=ix*fx+border_x; R(start_x,scr_y,scr_x-start_x,fy); start_x=-1; } continue; } scr_x=ix*fx+border_x; if (ch->attr&0x8) { color=ch->color&0xf; if (ch->attr&0x40) color^=0xf; if (color!=l_color || (ch->attr&0x03)!=l_attr) { if (start_x!=-1) { R(start_x,scr_y,scr_x-start_x,fy); start_x=scr_x; } l_color=color; l_attr=ch->attr&0x03; set_foreground(cur,l_color,l_attr); } } else { color=ch->color&0xf0; if (ch->attr&0x40) color^=0xf0; if (color!=l_color) { if (start_x!=-1) { R(start_x,scr_y,scr_x-start_x,fy); start_x=scr_x; } l_color=color; l_attr=ch->attr&0x03; set_background(cur,l_color,l_attr); } } if (start_x==-1) start_x=scr_x; } if (start_x!=-1) { scr_x=ix*fx+border_x; R(start_x,scr_y,scr_x-start_x,fy); } } /* now draw any dirty characters */ for (iy=y0;iy=0) ch=&SCREEN(x0,ry); else ch=&sbuf[x0+(max_scrollback+ry)*sx]; scr_y=(sy-1-iy)*fy+border_y; for (ix=x0;ixattr&0x80)) continue; ch->attr&=0x7f; scr_x=ix*fx+border_x; /* ~1700 cycles/change */ if (ch->attr&0x02 || (ch->ch!=0 && ch->ch!=32)) { if (!(ch->attr&0x8)) { color=ch->color&0xf; if (ch->attr&0x40) color^=0xf; if (color!=l_color || (ch->attr&0x03)!=l_attr) { l_color=color; l_attr=ch->attr&0x03; set_foreground(cur,l_color,l_attr); } } else { color=ch->color&0xf0; if (ch->attr&0x40) color^=0xf0; if (color!=l_color) { l_color=color; l_attr=ch->attr&0x03; set_background(cur,l_color,l_attr); } } } if (ch->ch!=0 && ch->ch!=32 && ch->ch!=MULTI_CELL_GLYPH) { total_draw++; if ((ch->attr&3)==2) { encoding=boldFont_encoding; f=boldFont; } else { encoding=font_encoding; f=font; } if (f!=current_font) { /* ~190 cycles/change */ [f set]; current_font=f; } /* we short-circuit utf8 for performance with back-art */ /* TODO: short-circuit latin1 too? */ if (encoding==NSUTF8StringEncoding) { unichar uch=ch->ch; if (uch>=0x800) { buf[2]=(uch&0x3f)|0x80; uch>>=6; buf[1]=(uch&0x3f)|0x80; uch>>=6; buf[0]=(uch&0x0f)|0xe0; buf[3]=0; } else if (uch>=0x80) { buf[1]=(uch&0x3f)|0x80; uch>>=6; buf[0]=(uch&0x1f)|0xc0; buf[2]=0; } else { buf[0]=uch; buf[1]=0; } } else { unichar uch=ch->ch; if (uch<=0x80) { buf[0]=uch; buf[1]=0; } else { unsigned char *pbuf=buf; int dlen=sizeof(buf)-1; GSFromUnicode(&pbuf,&dlen,&uch,1,encoding,NULL,GSUniTerminate); } } /* ~580 cycles */ DPSmoveto(cur,scr_x+fx0,scr_y+fy0); /* baseline here for mc-case 0.65 */ /* ~3800 cycles */ DPSshow(cur,buf); /* ~95 cycles to ARTGState -DPSshow:... */ /* ~343 cycles to isEmpty */ /* ~593 cycles to currentpoint */ /* ~688 cycles to transform */ /* ~1152 cycles to FTFont -drawString:... */ /* ~1375 cycles to -drawString:... setup */ /* ~1968 cycles cmap lookup */ /* ~2718 cycles sbit lookup */ /* ~~2750 cycles blit setup */ /* ~3140 cycles blit loop, empty call */ /* ~3140 cycles blit loop, setup */ /* ~3325 cycles blit loop, no write */ /* ~3800 cycles total */ } /* underline */ if (ch->attr&0x4) DPSrectfill(cur,scr_x,scr_y,fx,1); } } } if (draw_cursor) { float x,y; [[TerminalViewDisplayPrefs cursorColor] set]; x=cursor_x*fx+border_x; y=(sy-1-cursor_y+current_scroll)*fy+border_y; switch ([TerminalViewDisplayPrefs cursorStyle]) { case CURSOR_LINE: DPSrectfill(cur,x,y,fx,fy*0.1); break; case CURSOR_BLOCK_STROKE: DPSrectstroke(cur,x+0.5,y+0.5,fx-1.0,fy-1.0); break; case CURSOR_BLOCK_FILL: DPSrectfill(cur,x,y,fx,fy); break; case CURSOR_BLOCK_INVERT: DPScompositerect(cur,x,y,fx,fy, NSCompositeHighlight); break; } draw_cursor=NO; } NSDebugLLog(@"draw",@"total_draw=%i",total_draw); draw_all=1; } -(BOOL) isOpaque { return YES; } -(void) setNeedsDisplayInRect: (NSRect)r { draw_all=2; [super setNeedsDisplayInRect: r]; } -(void) setNeedsLazyDisplayInRect: (NSRect)r { if (draw_all==1) draw_all=0; [super setNeedsDisplayInRect: r]; } -(void) benchmark: (id)sender { int i; double t1,t2; NSRect r=[self frame]; t1=[NSDate timeIntervalSinceReferenceDate]; total_draw=0; for (i=0;i<100;i++) { draw_all=2; [self lockFocus]; [self drawRect: r]; [self unlockFocusNeedsFlush: NO]; } t2=[NSDate timeIntervalSinceReferenceDate]; t2-=t1; fprintf(stderr,"%8.4f %8.5f/redraw total_draw=%i\n",t2,t2/i,total_draw); } -(void) ts_setTitle: (NSString *)new_title type: (int)title_type { NSDebugLLog(@"ts",@"setTitle: %@ type: %i",new_title,title_type); if (title_type==1 || title_type==0) ASSIGN(title_miniwindow,new_title); if (title_type==2 || title_type==0) ASSIGN(title_window,new_title); [[NSNotificationCenter defaultCenter] postNotificationName: TerminalViewTitleDidChangeNotification object: self]; } -(void) ts_goto: (int)x:(int)y { NSDebugLLog(@"ts",@"goto: %i:%i",x,y); cursor_x=x; cursor_y=y; if (cursor_x>=sx) cursor_x=sx-1; if (cursor_x<0) cursor_x=0; if (cursor_y>=sy) cursor_y=sy-1; if (cursor_y<0) cursor_y=0; } -(void) ts_putChar: (screen_char_t)ch count: (int)c at: (int)x:(int)y { int i; screen_char_t *s; NSDebugLLog(@"ts",@"putChar: '%c' %02x %02x count: %i at: %i:%i", ch.ch,ch.color,ch.attr,c,x,y); if (y<0 || y>=sy) return; if (x+c>sx) c=sx-x; if (x<0) { c-=x; x=0; } s=&SCREEN(x,y); ch.attr|=0x80; for (i=0;isx*sy) c=sx*sy-ofs; if (ofs<0) { c-=ofs; ofs=0; } s=&SCREEN(ofs,0); ch.attr|=0x80; for (i=0;imax_scrollback) sb_length=max_scrollback; } if (t+nr >= b) nr = b - t - 1; if (b > sy || t >= b || nr < 1) return; d = &SCREEN(0,t); s = &SCREEN(0,t+nr); if (current_y>=t && current_y<=b) { SCREEN(current_x,current_y).attr|=0x80; draw_cursor=YES; /* TODO: does this properly handle the case when the cursor is in an area that gets scrolled 'over'? now it does, but not in an optimal way. handling of this could be optimized in all scrolling methods, but it probably won't make much difference */ } memmove(d, s, (b-t-nr) * sx * sizeof(screen_char_t)); if (!current_scroll) { if (t==0 && b==sy) { pending_scroll-=nr; } else { float x0,y0,w,h,dx,dy; if (pending_scroll) [self _handlePendingScroll: YES]; x0=0; w=fx*sx; y0=(t+nr)*fy; h=(b-t-nr)*fy; dx=0; dy=t*fy; y0=sy*fy-y0-h; dy=sy*fy-dy-h; [self lockFocus]; DPScomposite(GSCurrentContext(),border_x+x0,border_y+y0,w,h, [self gState],border_x+dx,border_y+dy,NSCompositeCopy); [self unlockFocusNeedsFlush: NO]; num_scrolls++; } } ADD_DIRTY(0,t,sx,b-t); } -(void) ts_scrollDown: (int)t:(int)b rows: (int)nr { screen_char_t *s; unsigned int step; NSDebugLLog(@"ts",@"scrollDown: %i:%i rows: %i", t,b,nr); if (t+nr >= b) nr = b - t - 1; if (b > sy || t >= b || nr < 1) return; s = &SCREEN(0,t); step = sx * nr; if (current_y>=t && current_y<=b) { SCREEN(current_x,current_y).attr|=0x80; draw_cursor=YES; } memmove(s + step, s, (b-t-nr)*sx*sizeof(screen_char_t)); if (!current_scroll) { if (t==0 && b==sy) { pending_scroll+=nr; } else { float x0,y0,w,h,dx,dy; if (pending_scroll) [self _handlePendingScroll: YES]; x0=0; w=fx*sx; y0=(t)*fy; h=(b-t-nr)*fy; dx=0; dy=(t+nr)*fy; y0=sy*fy-y0-h; dy=sy*fy-dy-h; [self lockFocus]; DPScomposite(GSCurrentContext(),border_x+x0,border_y+y0,w,h, [self gState],border_x+dx,border_y+dy,NSCompositeCopy); [self unlockFocusNeedsFlush: NO]; num_scrolls++; } } ADD_DIRTY(0,t,sx,b-t); } -(void) ts_shiftRow: (int)y at: (int)x0 delta: (int)delta { screen_char_t *s,*d; int x1,c; NSDebugLLog(@"ts",@"shiftRow: %i at: %i delta: %i", y,x0,delta); if (y<0 || y>=sy) return; if (x0<0 || x0>=sx) return; if (current_y==y) { SCREEN(current_x,current_y).attr|=0x80; draw_cursor=YES; } s=&SCREEN(x0,y); x1=x0+delta; c=sx-x0; if (x1<0) { x0-=x1; c+=x1; x1=0; } if (x1+c>sx) c=sx-x1; d=&SCREEN(x1,y); memmove(d,s,sizeof(screen_char_t)*c); if (!current_scroll) { float cx0,y0,w,h,dx,dy; if (pending_scroll) [self _handlePendingScroll: YES]; cx0=x0*fx; w=fx*c; dx=x1*fx; y0=y*fy; h=fy; dy=y0; y0=sy*fy-y0-h; dy=sy*fy-dy-h; [self lockFocus]; DPScomposite(GSCurrentContext(),border_x+cx0,border_y+y0,w,h, [self gState],border_x+dx,border_y+dy,NSCompositeCopy); [self unlockFocusNeedsFlush: NO]; num_scrolls++; } ADD_DIRTY(0,y,sx,1); } -(screen_char_t) ts_getCharAt: (int)x:(int)y { NSDebugLLog(@"ts",@"getCharAt: %i:%i",x,y); return SCREEN(x,y); } -(void) addDataToWriteBuffer: (const char *)data length: (int)len { if (!len) return; if (!write_buf_len) { [[NSRunLoop currentRunLoop] addEvent: (void *)master_fd type: ET_WDESC watcher: self forMode: NSDefaultRunLoopMode]; } if (write_buf_len+len>write_buf_size) { /* Round up to nearest multiple of 512 bytes. */ write_buf_size=(write_buf_len+len+511)&~511; write_buf=realloc(write_buf,write_buf_size); } memcpy(&write_buf[write_buf_len],data,len); write_buf_len+=len; } -(void) ts_sendCString: (const char *)msg { [self ts_sendCString: msg length: strlen(msg)]; } -(void) ts_sendCString: (const char *)msg length: (int)len { int l; if (master_fd==-1) return; if (write_buf_len) { [self addDataToWriteBuffer: msg length: len]; return; } l=write(master_fd,msg,len); if (l!=len) { if (errno!=EAGAIN) NSLog(_(@"Unexpected error while writing: %m.")); if (l<0) l=0; [self addDataToWriteBuffer: &msg[l] length: len-l]; } } -(BOOL) useMultiCellGlyphs { return use_multi_cell_glyphs; } -(int) relativeWidthOfCharacter: (unichar)ch { int s; if (!use_multi_cell_glyphs) return 1; s=ceil([font boundingRectForGlyph: ch].size.width/fx); if (s<1) return 1; return s; } -(void) viewPrefsDidChange: (NSNotification *)n { /* TODO: handle font changes? */ [self setNeedsDisplay: YES]; } @end /** Scrolling **/ @implementation TerminalView (scrolling) -(void) _updateScroller { if (sb_length) { [scroller setEnabled: YES]; [scroller setFloatValue: (current_scroll+sb_length)/(float)(sb_length) knobProportion: sy/(float)(sy+sb_length)]; } else { [scroller setEnabled: NO]; } } -(void) _scrollTo: (int)new_scroll update: (BOOL)update { if (new_scroll>0) new_scroll=0; if (new_scroll<-sb_length) new_scroll=-sb_length; if (new_scroll==current_scroll) return; current_scroll=new_scroll; if (update) { [self _updateScroller]; } [self setNeedsDisplay: YES]; } -(void) scrollWheel: (NSEvent *)e { float delta=[e deltaY]; int new_scroll; int mult; if ([e modifierFlags]&NSShiftKeyMask) mult=1; else if ([e modifierFlags]&NSControlKeyMask) mult=sy; else mult=5; new_scroll=current_scroll-delta*mult; [self _scrollTo: new_scroll update: YES]; } -(void) _updateScroll: (id)sender { int new_scroll; int part=[scroller hitPart]; BOOL update=YES; if (part==NSScrollerKnob || part==NSScrollerKnobSlot) { float f=[scroller floatValue]; new_scroll=(f-1.0)*sb_length; update=NO; } else if (part==NSScrollerDecrementLine) new_scroll=current_scroll-1; else if (part==NSScrollerDecrementPage) new_scroll=current_scroll-sy/2; else if (part==NSScrollerIncrementLine) new_scroll=current_scroll+1; else if (part==NSScrollerIncrementPage) new_scroll=current_scroll+sy/2; else return; [self _scrollTo: new_scroll update: update]; } -(void) setScroller: (NSScroller *)sc { [scroller setTarget: nil]; ASSIGN(scroller,sc); [self _updateScroller]; [scroller setTarget: self]; [scroller setAction: @selector(_updateScroll:)]; } @end /** Keyboard events **/ @implementation TerminalView (keyboard) -(void) keyDown: (NSEvent *)e { NSString *s=[e charactersIgnoringModifiers]; NSDebugLLog(@"key",@"got key flags=%08x repeat=%i '%@' '%@' %4i %04x %i %04x %i\n", [e modifierFlags],[e isARepeat],[e characters],[e charactersIgnoringModifiers],[e keyCode], [[e characters] characterAtIndex: 0],[[e characters] length], [[e charactersIgnoringModifiers] characterAtIndex: 0],[[e charactersIgnoringModifiers] length]); if ([s length]==1 && ([e modifierFlags]&NSShiftKeyMask)) { unichar ch=[s characterAtIndex: 0]; if (ch==NSPageUpFunctionKey) { [self _scrollTo: current_scroll-sy+1 update: YES]; return; } if (ch==NSPageDownFunctionKey) { [self _scrollTo: current_scroll+sy-1 update: YES]; return; } } /* don't check until we get here so we handle scrollback page-up/down even when the view's idle */ if (master_fd==-1) return; [tp handleKeyEvent: e]; } -(BOOL) acceptsFirstResponder { return YES; } -(BOOL) becomeFirstResponder { return YES; } -(BOOL) resignFirstResponder { return YES; } @end /** Selection, copy/paste/services **/ @implementation TerminalView (selection) -(NSString *) _selectionAsString { int ofs=max_scrollback*sx; NSMutableString *mstr; NSString *tmp; unichar buf[32]; unichar ch; int len,ws_len; int i,j; if (selection.length==0) return nil; mstr=[[NSMutableString alloc] init]; j=selection.location+selection.length; len=0; for (i=selection.location;ij) { ws_len=0; /* make sure we break out of the outer loop */ break; } if (len) { tmp=[[NSString alloc] initWithCharacters: buf length: len]; [mstr appendString: tmp]; DESTROY(tmp); len=0; } [mstr appendString: @"\n"]; ws_len=0; continue; } } i-=ws_len; for (;i=j) break; buf[len++]=ch; if (len==32) { tmp=[[NSString alloc] initWithCharacters: buf length: 32]; [mstr appendString: tmp]; DESTROY(tmp); len=0; } } if (len) { tmp=[[NSString alloc] initWithCharacters: buf length: len]; [mstr appendString: tmp]; DESTROY(tmp); } return AUTORELEASE(mstr); } -(void) _setSelection: (struct selection_range)s { int i,j,ofs2; if (s.location<-sb_length*sx) { s.length+=sb_length*sx+s.location; s.location=-sb_length*sx; } if (s.location+s.length>sx*sy) { s.length=sx*sy-s.location; } if (!s.length && !selection.length) return; if (s.length==selection.length && s.location==selection.location) return; ofs2=max_scrollback*sx; j=selection.location+selection.length; if (j>s.location) j=s.location; for (i=selection.location;i=j;i--) { if (i<0) ch2=sbuf[ofs+i].ch; else ch2=screen[i].ch; if (ch2==0) ch2=' '; if (![cs characterIsMember: ch2]) break; } s.location=i+1; /* and forwards... */ j+=sx; for (i=pos+1;i=sx) p.x=sx-1; p.y=ceil((p.y-border_y)/fy); if (p.y<-1) p.y=-1; if (p.y>sy) p.y=sy; p.y=sy-p.y+current_scroll; ofs1=((int)p.x)+((int)p.y)*sx; r1=[self _selectionRangeAt: ofs1 granularity: g]; if (first) { ofs0=ofs1; first=0; r0=r1; } NSDebugLLog(@"select",@"ofs %i %i (%i+%i) (%i+%i)\n", ofs0,ofs1, r0.location,r0.length, r1.location,r1.length); if (ofs1>ofs0) { s.location=r0.location; s.length=r1.location+r1.length-r0.location; } else { s.location=r1.location; s.length=r0.location+r0.length-r1.location; } [self _setSelection: s]; [self displayIfNeeded]; e=[NSApp nextEventMatchingMask: NSLeftMouseDownMask|NSLeftMouseUpMask| NSLeftMouseDraggedMask|NSMouseMovedMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; } if (selection.length) { [self writeSelectionToPasteboard: [NSPasteboard pasteboardWithName: @"Selection"] types: [NSArray arrayWithObject: NSStringPboardType]]; } } -(void) otherMouseUp: (NSEvent *)e { NSPasteboard *pb=[NSPasteboard pasteboardWithName: @"Selection"]; NSString *type; NSString *str; type=[pb availableTypeFromArray: [NSArray arrayWithObject: NSStringPboardType]]; if (!type) return; str=[pb stringForType: NSStringPboardType]; if (str) [tp sendString: str]; } @end /** Handle master_fd **/ @implementation TerminalView (input) -(NSDate *) timedOutEvent: (void *)data type: (RunLoopEventType)t forMode: (NSString *)mode { NSLog(@"timedOutEvent:type:forMode: ignored"); return nil; } -(void) readData { char buf[256]; int size,total,i; // get_zombies(); total=0; num_scrolls=0; dirty.x0=-1; current_x=cursor_x; current_y=cursor_y; [self _clearSelection]; /* TODO? */ NSDebugLLog(@"term",@"receiving output"); while (1) { size=read(master_fd,buf,sizeof(buf)); if (size<0 && errno==EAGAIN) break; if (size<=0) { NSString *msg; int i,c; unichar ch; // get_zombies(); [self closeProgram]; msg=_(@"[Process exited]"); c=[msg length]; for (i=0;i=8192 || (num_scrolls+abs(pending_scroll))>10) break; } if (cursor_x!=current_x || cursor_y!=current_y) { ADD_DIRTY(current_x,current_y,1,1); SCREEN(current_x,current_y).attr|=0x80; ADD_DIRTY(cursor_x,cursor_y,1,1); draw_cursor=YES; } NSDebugLLog(@"term",@"done (%i %i) (%i %i)\n", dirty.x0,dirty.y0,dirty.x1,dirty.y1); if (dirty.x0>=0) { NSRect dr; // NSLog(@"dirty=(%i %i)-(%i %i)\n",dirty.x0,dirty.y0,dirty.x1,dirty.y1); dr.origin.x=dirty.x0*fx; dr.origin.y=dirty.y0*fy; dr.size.width=(dirty.x1-dirty.x0)*fx; dr.size.height=(dirty.y1-dirty.y0)*fy; dr.origin.y=fy*sy-(dr.origin.y+dr.size.height); // NSLog(@"-> dirty=(%g %g)+(%g %g)\n",dirty.origin.x,dirty.origin.y,dirty.size.width,dirty.size.height); dr.origin.x+=border_x; dr.origin.y+=border_y; [self setNeedsLazyDisplayInRect: dr]; if (current_scroll!=0) { /* TODO */ current_scroll=0; [self setNeedsDisplay: YES]; } [self _updateScroller]; } } -(void) writePendingData { int l,new_size; l=write(master_fd,write_buf,write_buf_len); if (l<0) { if (errno!=EAGAIN) NSLog(_(@"Unexpected error while writing: %m.")); return; } memmove(write_buf,&write_buf[l],write_buf_len-l); write_buf_len-=l; /* If less than half the buffer is empty, reallocate it, but never free it completely. */ new_size=(write_buf_len+511)&~511; if (!new_size) new_size=512; if (new_size<=write_buf_size/2) { write_buf_size=new_size; write_buf=realloc(write_buf,write_buf_size); } if (!write_buf_len) { [[NSRunLoop currentRunLoop] removeEvent: (void *)master_fd type: ET_WDESC forMode: NSDefaultRunLoopMode all: YES]; } } -(void) receivedEvent: (void *)data type: (RunLoopEventType)type extra: (void *)extra forMode: (NSString *)mode { if (type==ET_WDESC) [self writePendingData]; else if (type==ET_RDESC) [self readData]; } -(void) closeProgram { if (master_fd==-1) return; NSDebugLLog(@"pty",@"closing master fd=%i\n",master_fd); [[NSRunLoop currentRunLoop] removeEvent: (void *)master_fd type: ET_RDESC forMode: NSDefaultRunLoopMode all: YES]; [[NSRunLoop currentRunLoop] removeEvent: (void *)master_fd type: ET_WDESC forMode: NSDefaultRunLoopMode all: YES]; write_buf_len=write_buf_size=0; free(write_buf); write_buf=NULL; close(master_fd); master_fd=-1; } -(void) runProgram: (NSString *)path withArguments: (NSArray *)args inDirectory: (NSString *)directory initialInput: (NSString *)d arg0: (NSString *)arg0 { int ret; struct winsize ws; NSRunLoop *rl; const char *cpath; const char *cargs[[args count]+2]; const char *cdirectory; int i; int pipefd[2]; int flags; NSDebugLLog(@"pty",@"-runProgram: %@ withArguments: %@ initialInput: %@", path,args,d); [self closeProgram]; cpath=[path cString]; if (arg0) cargs[0]=[arg0 cString]; else cargs[0]=cpath; cdirectory=[directory cString]; for (i=0;i<[args count];i++) { cargs[i+1]=[[args objectAtIndex: i] cString]; } cargs[i+1]=NULL; if (d) { if (pipe(pipefd)) { NSLog(_(@"Unable to open pipe for input: %m.")); return; } NSDebugLLog(@"pty",@"creating pipe for initial data, got %i %i", pipefd[0],pipefd[1]); } ws.ws_row=sy; ws.ws_col=sx; ret=forkpty(&master_fd,NULL,NULL,&ws); if (ret<0) { NSLog(_(@"Unable to fork: %m.")); return; } if (ret==0) { if (d) { close(pipefd[1]); dup2(pipefd[0],0); } if (cdirectory) chdir(cdirectory); putenv("TERM=linux"); putenv("TERM_PROGRAM=GNUstep_Terminal"); execv(cpath,(char *const*)cargs); fprintf(stderr,"Unable to spawn process '%s': %m!",cpath); exit(1); } NSDebugLLog(@"pty",@"forked child %i, fd %i",ret,master_fd); /* Set non-blocking mode for the descriptor. */ flags=fcntl(master_fd,F_GETFL,0); if (flags==-1) { NSLog(_(@"Unable to set non-blocking mode: %m.")); } else { flags|=O_NONBLOCK; fcntl(master_fd,F_SETFL,flags); } rl=[NSRunLoop currentRunLoop]; [rl addEvent: (void *)master_fd type: ET_RDESC watcher: self forMode: NSDefaultRunLoopMode]; [[NSNotificationCenter defaultCenter] postNotificationName: TerminalViewBecameNonIdleNotification object: self]; if (d) { const char *s=[d UTF8String]; close(pipefd[0]); write(pipefd[1],s,strlen(s)); close(pipefd[1]); } DESTROY(title_window); if (args) title_window=[[NSString stringWithFormat: @"%@ %@", path,[args componentsJoinedByString: @" "]] retain]; else title_window=[path copy]; ASSIGN(title_miniwindow,path); [[NSNotificationCenter defaultCenter] postNotificationName: TerminalViewTitleDidChangeNotification object: self]; } -(void) runProgram: (NSString *)path withArguments: (NSArray *)args initialInput: (NSString *)d { [self runProgram: path withArguments: args inDirectory: nil initialInput: d arg0: path]; } -(void) runShell { NSString *arg0; NSString *path; path=[TerminalViewShellPrefs shell]; if ([TerminalViewShellPrefs loginShell]) arg0=[@"-" stringByAppendingString: path]; else arg0=path; [self runProgram: path withArguments: nil inDirectory: nil initialInput: nil arg0: arg0]; } @end /** drag'n'drop support **/ @implementation TerminalView (drag_n_drop) static int handled_mask= NSDragOperationCopy|NSDragOperationPrivate|NSDragOperationGeneric; -(unsigned int) draggingEntered: (id)sender { NSArray *types=[[sender draggingPasteboard] types]; unsigned int mask=[sender draggingSourceOperationMask]; NSDebugLLog(@"dragndrop",@"TerminalView draggingEntered mask=%x types=%@",mask,types); if (mask&handled_mask && ([types containsObject: NSFilenamesPboardType] || [types containsObject: NSStringPboardType])) return NSDragOperationCopy; return 0; } /* TODO: should I really have to implement this? */ -(BOOL) prepareForDragOperation: (id)sender { NSDebugLLog(@"dragndrop",@"preparing for drag"); return YES; } -(BOOL) performDragOperation: (id)sender { NSPasteboard *pb=[sender draggingPasteboard]; NSArray *types=[pb types]; unsigned int mask=[sender draggingSourceOperationMask]; NSDebugLLog(@"dragndrop",@"performDrag %x %@",mask,types); if (!(mask&handled_mask)) return NO; if ([types containsObject: NSFilenamesPboardType]) { NSArray *data; int i,c; data=[pb propertyListForType: NSFilenamesPboardType]; if (!data) data=[NSUnarchiver unarchiveObjectWithData: [pb dataForType: NSFilenamesPboardType]]; c=[data count]; for (i=0;insx) copy_sx=nsx; // NSLog(@"copy %i+%i %i (%ix%i)-(%ix%i)\n",start,num,copy_sx,sx,sy,nsx,nsy); /* TODO: handle resizing and scrollback improve? */ for (iy=-sb_length;iymax_scrollback) sb_length=max_scrollback; if (sb_length<0) sb_length=0; sx=nsx; sy=nsy; free(screen); free(sbuf); screen=nscreen; sbuf=nsbuf; if (cursor_x>sx) cursor_x=sx-1; if (cursor_y>sy) cursor_y=sy-1; [self _updateScroller]; [tp setTerminalScreenWidth: sx height: sy]; if (master_fd!=-1) { ws.ws_row=nsy; ws.ws_col=nsx; ioctl(master_fd,TIOCSWINSZ,&ws); } [self setNeedsDisplay: YES]; } -(void) setFrame: (NSRect)frame { [super setFrame: frame]; [self _resizeTerminalTo: frame.size]; } -(void) setFrameSize: (NSSize)size { [super setFrameSize: size]; [self _resizeTerminalTo: size]; } - initWithFrame: (NSRect)frame { sx=80; sy=25; if (!(self=[super initWithFrame: frame])) return nil; { NSSize s; NSRect r; font=[TerminalViewDisplayPrefs terminalFont]; [font retain]; boldFont=[TerminalViewDisplayPrefs boldTerminalFont]; [boldFont retain]; r=[font boundingRectForFont]; s=[TerminalView characterCellSize]; fx=s.width; fy=s.height; /* TODO: clear up font metrics issues with xlib/backart */ NSLog(@"NSFont %@ info %@ size %g %@ %d", font, [font fontInfo], [font pointSize], NSStringFromRect([font boundingRectForGlyph: 'A']), [font glyphIsEncoded: 'A']); fx0=-r.origin.x; fy0=-r.origin.y; NSDebugLLog(@"term",@"Bounding (%g %g)+(%g %g)",-fx0,-fy0,fx,fy); font_encoding=[font mostCompatibleStringEncoding]; boldFont_encoding=[boldFont mostCompatibleStringEncoding]; NSDebugLLog(@"term",@"encoding %i and %i", font_encoding,boldFont_encoding); } use_multi_cell_glyphs=[TerminalViewDisplayPrefs useMultiCellGlyphs]; screen=malloc(sizeof(screen_char_t)*sx*sy); memset(screen,0,sizeof(screen_char_t)*sx*sy); draw_all=2; max_scrollback=[TerminalViewDisplayPrefs scrollBackLines]; sbuf=malloc(sizeof(screen_char_t)*sx*max_scrollback); memset(sbuf,0,sizeof(screen_char_t)*sx*max_scrollback); tp=[[TerminalParser_Linux alloc] initWithTerminalScreen: self width: sx height: sy]; master_fd=-1; [self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType,NSStringPboardType,nil]]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(viewPrefsDidChange:) name: TerminalViewDisplayPrefsDidChangeNotification object: nil]; return self; } -(void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; [self closeProgram]; DESTROY(tp); [scroller setTarget: nil]; DESTROY(scroller); free(screen); free(sbuf); screen=NULL; sbuf=NULL; DESTROY(font); DESTROY(boldFont); DESTROY(title_window); DESTROY(title_miniwindow); [super dealloc]; } -(NSString *) windowTitle { return title_window; } -(NSString *) miniwindowTitle { return title_miniwindow; } -(void) setIgnoreResize: (BOOL)ignore { ignore_resize=ignore; } -(void) setBorder: (float)x : (float)y { border_x=x; border_y=y; } +(NSSize) characterCellSize { NSFont *f=[TerminalViewDisplayPrefs terminalFont]; NSSize s; s=[f boundingRectForFont].size; if ([TerminalViewDisplayPrefs useMultiCellGlyphs]) { s.width=[f boundingRectForGlyph: 'A'].size.width; } return s; } +(void) registerPasteboardTypes { NSArray *types=[NSArray arrayWithObject: NSStringPboardType]; [NSApp registerServicesMenuSendTypes: types returnTypes: nil]; } @end Terminal-0.9.8/TerminalParser_Linux.h0000644000175000001440000000310311016341203017010 0ustar multixusers/* copyright 2002 Alexander Malmberg This file is a part of Terminal.app. Terminal.app is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See COPYING or main.m for more information. */ /* parses escape sequences for 'TERM=linux' */ #ifndef LinuxParser_h #define LinuxParser_h #include #include "Terminal.h" @interface TerminalParser_Linux : NSObject { id ts; int width,height; unsigned int tab_stop[8]; int x,y; int top,bottom; unsigned int unich; int utf_count; unsigned char input_buf[16]; int input_buf_len; #define TITLE_BUF_SIZE 255 char title_buf[TITLE_BUF_SIZE+1]; int title_len, title_type; enum { ESnormal, ESesc, ESsquare, ESgetpars, ESgotpars, ESfunckey, EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd, ESpalette, EStitle_semi, EStitle_buf } ESstate; int vc_state; unsigned char decscnm,decom,decawm,deccm,decim; unsigned char ques; unsigned char charset,utf,disp_ctrl,toggle_meta; int G0_charset,G1_charset; const unichar *translate; unsigned int intensity,underline,reverse,blink; unsigned int color,def_color; #define foreground (color & 0x0f) #define background (color & 0xf0) screen_char_t video_erase_char; #define NPAR 16 int npar; int par[NPAR]; int saved_x,saved_y; unsigned int s_intensity,s_underline,s_blink,s_reverse,s_charset,s_color; int saved_G0,saved_G1; iconv_t iconv_state; iconv_t iconv_input_state; } @end #endif Terminal-0.9.8/Norwegian.lproj/0000755000175000001440000000000011667362252015634 5ustar multixusersTerminal-0.9.8/Norwegian.lproj/Localizable.strings0000644000175000001440000001716211016341203021454 0ustar multixusers/*** English.lproj/Localizable.strings updated by make_strings 2002-12-09 18:39:08 +0100 add comments above this one Translated by Per Christian Gaustad, svele@netcom.no ***/ /*** Keys found in multiple places ***/ /* File: ServicesParameterWindowController.m:98 */ /* File: ServicesPrefs.m:653 */ "Command line:" = "Kommandolinje:"; /*** Strings from PreferencesWindowController.m ***/ /* File: PreferencesWindowController.m:78 */ "Apply and save" = "Bruk og lagre"; /* File: PreferencesWindowController.m:122 */ "Preferences" = "Egenskaper"; /* File: PreferencesWindowController.m:70 */ "Revert" = "Tilbake"; /*** Strings from Services.m ***/ /* File: Services.m:152 */ "Service aborted by user." = "Tjeneste avbrutt av bruker."; /* File: Services.m:60 */ "There is no terminal service called '%@'.\nYour services list is probably out-of-date.\nRun 'make_services' to update it." = "Det er ingen terminaltjeneste kalt '%@'.\nTjenestelisten din er trolig foreldret.\nKj\U00f8r 'make_services' for \U00e5 oppdatere den."; /*** Strings from ServicesParameterWindowController.m ***/ /* File: ServicesParameterWindowController.m:66 */ "Cancel" = "Avbryt"; /* File: ServicesParameterWindowController.m:74 */ "OK" = "OK"; /* File: ServicesParameterWindowController.m:118 */ "Parameter for service %@" = "Parameter for tjeneste %@"; /*** Strings from ServicesPrefs.m ***/ /* File: ServicesPrefs.m:585 */ "Accept types" = "Godta typer"; /* File: ServicesPrefs.m:499 */ "Add" = "Legg til"; /* File: ServicesPrefs.m:348 */ "Error importing services" = "Veil under import av tjenester"; /* File: ServicesPrefs.m:401 */ "Export services" = "Eksporter tjenester"; /* File: ServicesPrefs.m:523 */ "Export..." = "Eksporter..."; /* File: ServicesPrefs.m:594 */ "Filenames" = "Filnavn"; /* File: ServicesPrefs.m:549 */ "Ignore output" = "Ignorer resultat"; /* File: ServicesPrefs.m:254 */ "Import services" = "Importer tjenester"; /* File: ServicesPrefs.m:515 */ "Import..." = "Importer..."; /* File: ServicesPrefs.m:559 */ "Input in stdin" = "Input i stdin"; /* File: ServicesPrefs.m:560 */ "Input on command line" = "Input p\U00e5 kommandolinje"; /* File: ServicesPrefs.m:640 */ "Key:" = "N\U00f8kkel:"; /* File: ServicesPrefs.m:627 */ "Name:" = "Navn:"; /* File: ServicesPrefs.m:558 */ "No input" = "Ingen input"; /* File: ServicesPrefs.m:602 */ "Plain text" = "Ren tekst"; /* File: ServicesPrefs.m:507 */ "Remove" = "Fjern"; /* File: ServicesPrefs.m:550 */ "Return output" = "Returner utdata"; /* File: ServicesPrefs.m:568 */ "Run in background" = "Kj\U00f8r i bakgrunnen"; /* File: ServicesPrefs.m:570 */ "Run in idle window" = "Kj\U00f8r i Run in ledig vindu"; /* File: ServicesPrefs.m:569 */ "Run in new window" = "Kj\U00f8r i nytt vindu"; /* File: ServicesPrefs.m:468 */ "Terminal services" = "Terminaltjenester"; /* File: ServicesPrefs.m:473 */ "Terminal\nservices" = "Terminal\ntjenester"; /* File: ServicesPrefs.m:349 */ "The file '%@' doesn't contain valid terminal services." = "Filen '%@' inneholder ikke gyldige terminaltjenester."; /* File: ServicesPrefs.m:235 */ "Unnamed service" = "Tjeneste uten navn"; /*** Strings from TerminalParser_LinuxPrefs.m ***/ /* File: TerminalParser_LinuxPrefs.m:103 */ "'linux' terminal parser" = "'linux' terminalparser"; /* File: TerminalParser_LinuxPrefs.m:108 */ "'linux'\nparser" = "'linux'\nparser"; /* File: TerminalParser_LinuxPrefs.m:151 */ "Character set:" = "Tegnsett:"; /* File: TerminalParser_LinuxPrefs.m:43 */ "Chinese" = "Kinesisk"; /* File: TerminalParser_LinuxPrefs.m:44 */ "Custom, leave unchanged" = "Egendefinert, ikke endre"; /* File: TerminalParser_LinuxPrefs.m:42 */ "East Europe, latin2" = "\U00d8st-Europa, latin2"; /* File: TerminalParser_LinuxPrefs.m:40 */ "UTF-8" = "UTF-8"; /* File: TerminalParser_LinuxPrefs.m:41 */ "West Europe, latin1" = "Vest-Europa, latin1"; /*** Strings from TerminalView.m ***/ /* File: TerminalView.m:1623 */ "Unable to fork: %m." = "Kunne ikke ``forke'': %m."; /* File: TerminalView.m:1611 */ "Unable to open pipe for input: %m." = "Kunn ikke \U00e5pne ``pipe'' for input: %m."; /* File: TerminalView.m:1476 */ "[Process exited]" = "[Prosess avsluttet]"; /*** Strings from TerminalViewPrefs.m ***/ /* File: TerminalViewPrefs.m:330 */ "Bold font:" = "Fet skrifttype:"; /* File: TerminalViewPrefs.m:298 */ "Color:" = "Farge:"; /* File: TerminalViewPrefs.m:277 */ "Cursor" = "Mark\U00f8r"; /* File: TerminalViewPrefs.m:230 */ /* File: TerminalViewPrefs.m:225 */ "Display" = "Vis"; /* File: TerminalViewPrefs.m:291 */ "Filled block" = "Fylt blokk"; /* File: TerminalViewPrefs.m:319 */ "Handle wide (multi-cell) glyphs" = "H\U00e5ndtere brede (multi-celle) ``glyphs''"; /* File: TerminalViewPrefs.m:292 */ "Inverted block" = "speilvendt blokk"; /* File: TerminalViewPrefs.m:607 */ /* File: TerminalViewPrefs.m:602 */ "Keyboard" = "Tastatur"; /* File: TerminalViewPrefs.m:289 */ "Line" = "Linje"; /* File: TerminalViewPrefs.m:357 */ "Normal font:" = "Normal skrifttype:"; /* File: TerminalViewPrefs.m:369 */ /* File: TerminalViewPrefs.m:342 */ "Pick font..." = "Velg skrifttype..."; /* File: TerminalViewPrefs.m:255 */ "Scroll-back length in lines:" = "Skriftrulle-tilbeke lengde i linjer:"; /* File: TerminalViewPrefs.m:651 */ "Send a double escape for the escape key.\n\nThis means that the escape key will be\nrecognized faster by many programs, but\nyou can't use it as a substitute for meta." = "Send dobbelt escape for escape-tasten.\n\nDette betyr at escape-tasten vil bli \ngjenkjent raskere av mange program, men\ndu kan ikke bruke den som en erstatning for meta."; /* File: TerminalViewPrefs.m:492 */ /* File: TerminalViewPrefs.m:487 */ "Shell" = "Skall"; /* File: TerminalViewPrefs.m:527 */ "Shell:" = "Skall:"; /* File: TerminalViewPrefs.m:515 */ "Start as login-shell" = "Start som innlogginsskall"; /* File: TerminalViewPrefs.m:290 */ "Stroked block" = "Slag-blokk"; /* File: TerminalViewPrefs.m:282 */ "Style:" = "Stil:"; /* File: TerminalViewPrefs.m:634 */ "Treat the command key as meta.\n\nNote that with this enabled, you won't be\nable to access menu entries with the\nkeyboard." = "Behandle kommandoknappen som meta.\n\nMerk at med dette p\U00e5sl\U00e5tt, vil ikke du ha noen \nmulighet til \U00e5 f\U00e5 adgang til menyene med \ntastaturet."; /*** Strings from TerminalWindow.m ***/ /* File: TerminalWindow.m:192 */ /* File: TerminalWindow.m:188 */ " (idle)" = " (ledig)"; /*** Strings from TerminalWindowPrefs.m ***/ /* File: TerminalWindowPrefs.m:192 */ "Add top and bottom border" = "Legg til topp- og bunngrense"; /* File: TerminalWindowPrefs.m:143 */ "Close new windows when idle" = "Lukk nye vindu n\U00e5r ledig"; /* File: TerminalWindowPrefs.m:156 */ "Default size" = "Standard st\U00f8rrelse"; /* File: TerminalWindowPrefs.m:144 */ "Don't close new windows" = "Ikke lukk nye vindu"; /* File: TerminalWindowPrefs.m:169 */ "Height:" = "H\U00f8yde:"; /* File: TerminalWindowPrefs.m:112 */ "Terminal Window" = "Terminalvindu"; /* File: TerminalWindowPrefs.m:117 */ "Terminal\nWindow" = "Terminal\nvindow"; /* File: TerminalWindowPrefs.m:160 */ "Width:" = "Bredde:"; /*** Strings from main.m ***/ /* File: main.m:157 */ "Benchmark" = "Sjekk prestasjon"; /* File: main.m:191 */ "Close" = "Lukk"; /* File: main.m:180 */ "Copy" = "Kopier"; /* File: main.m:177 */ "Cut" = "Klipp ut"; /* File: main.m:186 */ "Edit" = "Rediger"; /* File: main.m:203 */ "Hide" = "Skjul"; /* File: main.m:159 */ "Info" = "Informasjon"; /* File: main.m:153 */ "Info..." = "Informasjon..."; /* File: main.m:171 */ "New terminal" = "Ny terminal"; /* File: main.m:183 */ "Paste" = "Lim inn"; /* File: main.m:155 */ "Preferences..." = "Egenskaper..."; /* File: main.m:207 */ "Quit" = "Avslutt"; /* File: main.m:199 */ "Services" = "Tjenester"; /* File: main.m:194 */ "Windows" = "Vinduer";