1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 01:06:01 +02:00

Bug 476709 - MacOSX PTY: Fix terminal change_window_size

Change-Id: I89b8c26f65671eaca20a0a5affb20c565f557419
Signed-off-by: Martin Oberhuber <martin.oberhuber@windriver.com>
This commit is contained in:
Martin Oberhuber 2015-09-16 23:11:44 +02:00 committed by Gerrit Code Review @ Eclipse.org
parent d334be2c61
commit 6a17a26b22
6 changed files with 9 additions and 4 deletions

View file

@ -1,5 +1,5 @@
#*******************************************************************************
# Copyright (c) 2002, 2009 QNX Software Systems and others.
# Copyright (c) 2002, 2015 QNX Software Systems and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@ -8,12 +8,13 @@
# Contributors:
# QNX Software Systems - initial API and implementation
# Alex Blewitt - MacOSX with a 64-bit vm
# Martin Oberhuber (Wind River) - Bug 476709 - Fix change_window_size()
#*******************************************************************************/
# makefile for libspawner.so
# See http://developer.apple.com/documentation/Java/Conceptual/Java141Development/Core_APIs/chapter_6_section_4.html
JAVA_HOME = $(shell echo /Library/Java/JavaVirtualMachines/jdk1.8.0_*.jdk/Contents/Home)
JAVA_HOME = $(shell echo /Library/Java/JavaVirtualMachines/jdk1.[78].0_*.jdk/Contents/Home)
# Defaults which can be overridden.
OS = macosx

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2009 QNX Software Systems and others.
* Copyright (c) 2002, 2015 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -7,10 +7,13 @@
*
* Contributors:
* QNX Software Systems - initial API and implementation
* Martin Oberhuber (Wind River) - Bug 476709 - Fix change_window_size()
*******************************************************************************/
#include "PTY.h"
#include "openpty.h"
#include <sys/ioctl.h>
/*
* Class: org_eclipse_cdt_utils_pty_PTY
* Method: forkpty
@ -52,7 +55,7 @@ Java_org_eclipse_cdt_utils_pty_PTY_openMaster (JNIEnv *env, jobject jobj, jboole
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size
(JNIEnv *env, jobject jobj, jint fdm, jint width, jint height)
{
#ifdef TIOCGWINSZ
#ifdef TIOCSWINSZ
struct winsize win;
win.ws_col = width;
@ -62,6 +65,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size
return ioctl(fdm, TIOCSWINSZ, &win);
#else
#error no TIOCSWINSZ
return 0;
#endif
}

Binary file not shown.

Binary file not shown.