diff options
author | Nalin Dahyabhai <nalin@src.gnome.org> | 2002-07-24 15:27:00 +0000 |
---|---|---|
committer | Nalin Dahyabhai <nalin@src.gnome.org> | 2002-07-24 15:27:00 +0000 |
commit | 9ef0f51ac6364aed4176f3d5f3843ab76c3e113f (patch) | |
tree | 0f1272fad6ebd53f8ce932c2927d5ce1d27b51f2 | |
parent | b8d3e0c105c1b8031e4d1606f2d9cac34b97ec3d (diff) |
Add private vte_pty_set_size() function. vte_pty_open() takes sizevte_0_5_3
* src/pty.c: Add private vte_pty_set_size() function.
* src/pty.c, src/pty.h: vte_pty_open() takes size arguments now.
* src/vte.c: Open the PTY with the proper initial size.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | po/sv.po | 40 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/pty.c | 31 | ||||
-rw-r--r-- | src/pty.h | 3 | ||||
-rw-r--r-- | src/vte.c | 8 | ||||
-rw-r--r-- | src/vteapp.c | 4 | ||||
-rw-r--r-- | vte.spec | 5 |
8 files changed, 64 insertions, 33 deletions
@@ -1,3 +1,7 @@ +2002-07-24 nalin + * src/pty.c: Add private vte_pty_set_size() function. + * src/pty.c, src/pty.h: vte_pty_open() takes size arguments now. + * src/vte.c: Open the PTY with the proper initial size. 2002-07-23 nalin * src/ring.c, ring.h: Expose the ring implementation and convert several simple functions into macros. @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vte\n" -"POT-Creation-Date: 2002-07-18 19:04+0200\n" +"POT-Creation-Date: 2002-07-23 14:33-0400\n" "PO-Revision-Date: 2002-07-18 19:08+0200\n" "Last-Translator: Christian Rose <menthos@menthos.com>\n" "Language-Team: Swedish <sv@li.org>\n" @@ -29,43 +29,43 @@ msgstr "Fel vid skapande av signalrör." msgid "Duplicate (%s/%s)!" msgstr "Dubbel (%s/%s)!" -#: src/vte.c:932 +#: src/vte.c:972 #, c-format msgid "Error compiling regular expression \"%s\"." msgstr "Fel vid kompilering av reguljärt uttryck \"%s\"." -#: src/vte.c:1303 src/vte.c:1312 src/vte.c:1322 src/vte.c:1336 src/vte.c:1341 -#: src/vte.c:1346 +#: src/vte.c:1343 src/vte.c:1352 src/vte.c:1362 src/vte.c:1376 src/vte.c:1381 +#: src/vte.c:1386 #, c-format msgid "Unable to convert characters from %s to %s." msgstr "Kan inte konvertera tecken från %s till %s." -#: src/vte.c:4307 +#: src/vte.c:4409 #, c-format msgid "Got unexpected (key?) sequence `%s'." msgstr "Fick oväntad (tangent?)sekvens \"%s\"." -#: src/vte.c:5010 +#: src/vte.c:5133 #, c-format msgid "Character 0x%x is undefined, allocating one column." msgstr "Tecknet 0x%x är odefinierat, allokerar en kolumn." -#: src/vte.c:5204 +#: src/vte.c:5324 #, c-format msgid "No handler for control sequence `%s' defined." msgstr "Ingen hanterare för kontrollsekvensen \"%s\" är angiven." -#: src/vte.c:5821 +#: src/vte.c:5953 #, c-format msgid "Error reading from child: %s." msgstr "Fel vid läsning från barn: %s." -#: src/vte.c:5989 +#: src/vte.c:6121 #, c-format msgid "Error (%s) converting data for child, dropping." msgstr "Fel (%s) vid konvertering av data för barn, kastar." -#: src/vte.c:7722 +#: src/vte.c:7865 #, c-format msgid "" "Warning: using fontset \"%s\", which is missing these character sets: %s." @@ -73,54 +73,54 @@ msgstr "" "Varning: använder typsnittssamlingen \"%s\", som saknar dessa " "teckensamlingar: %s." -#: src/vte.c:8255 +#: src/vte.c:8409 #, c-format msgid "Failed to load Xft font pattern \"%s\", falling back to default font." msgstr "" "Misslyckades med att läsa in XFt-typsnittsmönstret \"%s\", använder " "standardtypsnittet." -#: src/vte.c:8268 +#: src/vte.c:8422 msgid "Failed to load default Xft font." msgstr "Misslyckades med att läsa in Xft-standardtypsnittet." -#: src/vte.c:8311 +#: src/vte.c:8465 msgid "Error allocating Xft font, disabling Xft." msgstr "Fel vid allokering av Xft-typsnitt, deaktiverar Xft." -#: src/vte.c:8335 +#: src/vte.c:8489 #, c-format msgid "Failed to load font set \"%s\", falling back to default font." msgstr "" "Misslyckades med att läsa in typsnittssamlingen \"%s\", använder " "standardtypsnittet." -#: src/vte.c:8347 +#: src/vte.c:8501 msgid "Failed to load default font, crashing or behaving abnormally." msgstr "" "Misslyckades med att läsa in standardtypsnittet, kraschar eller beter sig " "onormalt." -#: src/vte.c:8430 +#: src/vte.c:8584 #, c-format msgid "Error reading PTY size, using defaults: %s." msgstr "Fel vid läsande av PTY-storlek, använder standardvärden: %s." -#: src/vte.c:8451 +#: src/vte.c:8610 #, c-format msgid "Error setting PTY size: %s." msgstr "Fel vid läsande av PTY-storlek: %s." -#: src/vte.c:10471 +#: src/vte.c:10723 msgid "Error allocating layout, disabling Pango." msgstr "Fel vid allokering av layout, deaktiverar Pango." -#: src/vte.c:10481 +#: src/vte.c:10733 msgid "Error allocating draw, disabling Xft." msgstr "Fel vid allokering av ritbar yta, deaktiverar Xft." #. Aaargh. We're screwed. -#: src/vte.c:11697 +#: src/vte.c:11952 msgid "g_iconv_open() failed setting word characters" msgstr "g_iconv_open() misslyckades med att ställa in ordtecken" diff --git a/src/Makefile.am b/src/Makefile.am index 3f27b32..e0316ff 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,7 +30,7 @@ libvte_la_SOURCES = \ vteaccess.h libvte_la_LIBADD = @LIBS@ @XFT_LIBS@ @GTK_LIBS@ @X_LIBS@ -libvte_la_LDFLAGS = -version-info 2:0:0 +libvte_la_LDFLAGS = -version-info 3:0:1 CLEANFILES = marshal.c marshal.h @@ -21,6 +21,7 @@ #include <sys/ioctl.h> #include <sys/types.h> #include <sys/wait.h> +#include <errno.h> #include <fcntl.h> #include <limits.h> #include <stdio.h> @@ -126,6 +127,19 @@ vte_pty_fork_on_fd(const char *path, char **env_add, _exit(0); } +static void +vte_pty_set_size(int master, int columns, int rows) +{ + struct winsize size; + memset(&size, 0, sizeof(size)); + size.ws_row = rows ? rows : 24; + size.ws_col = columns ? rows : 80; + if (ioctl(master, TIOCSWINSZ, &size) != 0) { + g_warning(_("Error setting PTY size: %s."), + strerror(errno)); + } +} + static char * vte_pty_ptsname(int master) { @@ -183,7 +197,8 @@ vte_pty_unlockpt(int fd) static int vte_pty_open_unix98(pid_t *child, char **env_add, - const char *command, char **argv) + const char *command, char **argv, + int columns, int rows) { int fd; char *buf; @@ -198,6 +213,8 @@ vte_pty_open_unix98(pid_t *child, char **env_add, close(fd); fd = -1; } else { + /* Set the window size. */ + vte_pty_set_size(fd, columns, rows); /* Start up a child process with the given command. */ if (vte_pty_fork_on_fd(buf, env_add, command, argv, child) != 0) { @@ -212,7 +229,8 @@ vte_pty_open_unix98(pid_t *child, char **env_add, static int vte_pty_open_old_school(pid_t *child, char **env_add, - const char *command, char **argv) + const char *command, char **argv, + int columns, int rows) { /* FIXME */ return -1; @@ -220,14 +238,17 @@ vte_pty_open_old_school(pid_t *child, char **env_add, int vte_pty_open(pid_t *child, char **env_add, - const char *command, char **argv) + const char *command, char **argv, + int columns, int rows) { int ret = -1; if (ret == -1) { - ret = vte_pty_open_unix98(child, env_add, command, argv); + ret = vte_pty_open_unix98(child, env_add, command, argv, + columns, rows); } if (ret == -1) { - ret = vte_pty_open_old_school(child, env_add, command, argv); + ret = vte_pty_open_old_school(child, env_add, command, argv, + columns, rows); } return ret; } @@ -29,7 +29,8 @@ G_BEGIN_DECLS * pseudo-terminal of its own, returning the descriptor for the master * side of the PTY pair, storing the child's PID in the given argument. */ int vte_pty_open(pid_t *child, char **env_add, - const char *command, char **argv); + const char *command, char **argv, + int columns, int rows); G_END_DECLS @@ -5387,7 +5387,9 @@ vte_terminal_fork_command(VteTerminal *terminal, const char *command, terminal->pvt->pty_master = vte_pty_open(&pid, env_add, command, - argv); + argv, + terminal->column_count, + terminal->row_count); for (i = 0; env_add[i] != NULL; i++) { g_free(env_add[i]); @@ -5410,8 +5412,8 @@ vte_terminal_fork_command(VteTerminal *terminal, const char *command, /* Set the PTY size. */ vte_terminal_set_size(terminal, - terminal->pvt->default_column_count, - terminal->pvt->default_row_count); + terminal->column_count, + terminal->row_count); if (GTK_WIDGET_REALIZED(widget)) { gtk_widget_queue_resize(widget); } diff --git a/src/vteapp.c b/src/vteapp.c index aafdcaf..5dd2d86 100644 --- a/src/vteapp.c +++ b/src/vteapp.c @@ -103,8 +103,8 @@ main(int argc, char **argv) "[-c command] " "[-f font] " "[-t terminaltype]\n"; - back.red = back.green = back.blue = 0x0000; - fore.red = fore.green = fore.blue = 0xbfff; + back.red = back.green = back.blue = 0xffff; + fore.red = fore.green = fore.blue = 0x3000; /* Pull out long options for GTK+. */ for (i = j = 1; i < argc; i++) { if (g_ascii_strncasecmp("--", argv[i], 2) == 0) { @@ -1,5 +1,5 @@ Name: vte -Version: 0.5.2 +Version: 0.5.3 Release: 1 Summary: An experimental terminal emulator. License: LGPL @@ -58,6 +58,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_libdir}/pkgconfig/* %changelog +* Wed Jul 24 2002 Nalin Dahyabhai <nalin@redhat.com> 0.5.3-1 +- open PTYs with the proper size (#69606) + * Tue Jul 23 2002 Nalin Dahyabhai <nalin@redhat.com> 0.5.2-1 - fix imbalanced realize/unrealize routines causing crashes (#69605) |