Tries to catch resize signals sent from the terminal.
544336
def _handle_resize(self, signum=None, frame=None):
        ''

        w, h = utils.get_terminal_size()
        self.term_width = w
1049466
def resizeEvent(self, event):
        """"""
        self._viewIsDirty = True
        super(StimulusView, self).resizeEvent(event)
1226848
def get_terminal_width():
    
    # http://www.brandonrubin.me/2014/03/18/python-snippet-get-terminal-width/
    command = ['tput', 'cols']
    try:
        width = int(subprocess.check_output(command))
    except OSError as e:
        print(
            "Invalid Command '{0}': exit status ({1})".format(
                command[0], e.errno))
    except subprocess.CalledProcessError as e:
        print(
            "'{0}' returned non-zero exit status: ({1})".format(
                command, e.returncode))
    else:
        return width
497281
function () {
        function checkUpdate() {
            var current = module.exports.current();
            if (current !== last) {
                last = current;
                events.trigger('update', current);
            }
        }

        // Do not run unless breakpoints are available.
        if (!running && breakpoints.length) {
            running = true;
            global.addEventListener('resize', function () {
                if (!working) {
                    working = true;
                    global.requestAnimationFrame(function () {
                        checkUpdate();
                        working = false;
                    });
                }
            });
        }
        checkUpdate();
    }
268321
def signals(self, signals=('QUIT', 'USR1', 'USR2')):
        ''''''
        for sig in signals:
            signal.signal(getattr(signal, 'SIG' + sig), self.handler)
196918
private static void handleSignals() {
        if (DaemonStarter.isRunMode()) {
            try {
                // handle SIGHUP to prevent process to get killed when exiting the tty
                Signal.handle(new Signal("HUP"), arg0 -> {
                    // Nothing to do here
                    System.out.println("SIG INT");
                });
            } catch (IllegalArgumentException e) {
                System.err.println("Signal HUP not supported");
            }

            try {
                // handle SIGTERM to notify the program to stop
                Signal.handle(new Signal("TERM"), arg0 -> {
                    System.out.println("SIG TERM");
                    DaemonStarter.stopService();
                });
            } catch (IllegalArgumentException e) {
                System.err.println("Signal TERM not supported");
            }

            try {
                // handle SIGINT to notify the program to stop
                Signal.handle(new Signal("INT"), arg0 -> {
                    System.out.println("SIG INT");
                    DaemonStarter.stopService();
                });
            } catch (IllegalArgumentException e) {
                System.err.println("Signal INT not supported");
            }

            try {
                // handle SIGUSR2 to notify the life-cycle listener
                Signal.handle(new Signal("USR2"), arg0 -> {
                    System.out.println("SIG USR2");
                    DaemonStarter.getLifecycleListener().signalUSR2();
                });
            } catch (IllegalArgumentException e) {
                System.err.println("Signal USR2 not supported");
            }
        }
    }
89382
function resizeImage(options, callback) {
  var size = options.size.width + 'x' + options.size.height;
  if (!options.size.maintainratio) {
    size += '\\!';
  }
  var command = [
    options.convert,
    options.org,
    '-adaptive-resize',
    options.size.width + 'x' + options.size.height,
    options.path
    ].join(' ');

  /* Create folder if we have to. */
  var dest = lib.path.join(options.dest, options.size.name);
  if (!lib.fs.existsSync(dest)) {
    lib.fs.mkdirSync(dest);
  }

  /* Create resize */
  lib.exec(command, function (err, stdout, stderr) {
    callback(err, options.path);
  });
}
603568
function handleWindowResize () {
    ctrl.lastSelectedIndex = ctrl.selectedIndex;
    ctrl.offsetLeft        = fixOffset(ctrl.offsetLeft);

    $mdUtil.nextTick(function () {
      ctrl.updateInkBarStyles();
      updatePagination();
    });
  }
65789
def resize(self, size=None):
        

        if not self.israw():
            return

        size = size or tty.size(self.stdout)

        if size is not None:
            rows, cols = size
            try:
                self.client.resize(self.container, height=rows, width=cols)
            except IOError: # Container already exited
                pass
1341433
def signal_handler(signal_name, frame):
    """"""
    sys.stdout.flush()
    print("\nSIGINT in frame signal received. Quitting...")
    sys.stdout.flush()
    sys.exit(0)
616401
def set_terminal_size(fd, size):
    """"""
    sizebuf = array.array('h', reversed(size))
    fcntl.ioctl(fd, termios.TIOCSWINSZ, sizebuf)
306061
def resizeEvent(self, event):
        
        super(XImageSlider, self).resizeEvent(event)
        
        self.recalculate()
168158
def sigint_handler(signum, frame):
    """"""
    global _handled_int
    if not _handled_int:
        _handled_int = True
        if not _env_var_true("_REZ_QUIET_ON_SIG"):
            print >> sys.stderr, "Interrupted by user"
        sigbase_handler(signum, frame)
800566
def resizeEvent(self, event):
        
        super(XLabel, self).resizeEvent(event)
        
        if self._lineEdit:
            self._lineEdit.resize(self.size())
1314146
def start(self):
        

        def handle(signum, frame):
            if signum == signal.SIGWINCH:
                self.pty.resize()

        self.original_handler = signal.signal(signal.SIGWINCH, handle)
282783
def _signal_handler(self, signal_interupt, frame):  # pylint: disable=W0613
        
        if self.container is not None:
            print('{}{}Stopping docker container.'.format(c.Style.BRIGHT, c.Fore.YELLOW))
            self.container.stop()
        print('{}{}Interrupt signal received.'.format(c.Style.BRIGHT, c.Fore.RED))
        self.log.error('tcrun received an interrupt signal and will now exit.')
        sys.exit(1)
1033813
def signal_handler(self, signum, frame):
        
        self.print_exit()
        print("\n(Terminated with signal %d)\n" % (signum))
        sys.exit(0)