Lines Matching full:if
74 if (cw1->window < cw2->window)
76 if (cw1->window > cw2->window)
91 if (c->session != NULL && (~c->flags & CLIENT_UNATTACHEDFLAGS))
113 if (c->overlay_draw != NULL)
119 if (event_initialized(&c->overlay_timer))
122 if (delay != 0)
133 if (c->overlay_check == NULL)
135 if (c->overlay_mode == NULL)
145 if (c->overlay_draw == NULL)
148 if (event_initialized(&c->overlay_timer))
151 if (c->overlay_free != NULL)
162 if (c->session != NULL)
182 if (py < y || py > y + sy - 1) {
191 if (px < x) {
194 if (r->nx[0] > nx)
203 if (px > ox)
206 if (onx > ox) {
215 /* Check if this client is inside this server. */
223 if (envent == NULL || *envent->value == '\0')
227 if (strcmp(wp->tty, c->ttyname) == 0)
237 if (name == NULL)
243 if (gettimeofday(&c->keytable->activity_time, NULL) != 0)
263 if (s == NULL)
267 if (*name == '\0')
291 if (gettimeofday(&c->creation_time, NULL) != 0)
321 /* Open client terminal if needed. */
327 if (c->flags & CLIENT_CONTROL)
330 if (strcmp(c->ttyname, ttynam) == 0||
344 if (!(c->flags & CLIENT_TERMINAL)) {
349 if (tty_open(&c->tty, cause) != 0)
371 if (w->latest != c)
377 if (loop == c || s == NULL || s->curw->window != w)
379 if (found == NULL || timercmp(&loop->activity_time,
383 if (found != NULL)
394 if (s != NULL && c->session != NULL && c->session != s)
396 else if (s == NULL)
401 if (old != NULL && old->curw != NULL)
403 if (s != NULL) {
446 if (c->flags & CLIENT_ATTACHED) {
451 if (c->flags & CLIENT_CONTROL)
453 if (c->flags & CLIENT_TERMINAL)
473 if (event_initialized(&c->message_timer))
486 if (c->out_fd != -1)
488 if (c->fd != -1) {
508 if (c->references == 0)
522 if (c->references == 0) {
534 if (s == NULL || (c->flags & CLIENT_UNATTACHEDFLAGS))
548 if (s == NULL || (c->flags & CLIENT_NODETACHFLAGS))
567 if (*cmd == '\0')
571 if (s != NULL)
575 if (!checkshell(shell))
602 if (window_pane_show_scrollbar(wp, sb)) {
609 if (pane_status == PANE_STATUS_TOP)
611 else if (pane_status == PANE_STATUS_BOTTOM)
614 /* Check if point is within the pane or scrollbar. */
615 if (((pane_status != PANE_STATUS_OFF && py != line) ||
622 /* Check if in the scrollbar. */
623 if ((sb_pos == PANE_SCROLLBARS_RIGHT &&
633 if (py < sl_top)
635 else if (py >= sl_top &&
645 } else if (~w->flags & WINDOW_ZOOMED) {
646 /* Try the pane borders if not zoomed. */
648 if ((((sb_pos == PANE_SCROLLBARS_RIGHT &&
659 if (fwp != NULL) {
696 if (event->key == KEYC_DOUBLECLICK) {
701 } else if ((m->sgr_type != ' ' &&
711 } else if (MOUSE_DRAG(m->b)) {
713 if (c->tty.mouse_drag_flag) {
715 if (x == m->lx && y == m->ly)
722 } else if (MOUSE_WHEEL(m->b)) {
726 } else if (MOUSE_RELEASE(m->b)) {
729 if (m->sgr_type == 'm')
733 if (c->flags & CLIENT_DOUBLECLICK) {
736 if (m->b == c->click_button) {
742 } else if (c->flags & CLIENT_TRIPLECLICK) {
745 if (m->b == c->click_button) {
754 if (type == NOTYPE) {
761 if (KEYC_CLICK_TIMEOUT != 0) {
774 if (type == NOTYPE)
786 if (m->statusat != -1 &&
790 if (sr == NULL) {
806 if (fwp == NULL)
816 if (fwl == NULL)
825 if (fs == NULL)
843 if (where == NOWHERE) {
844 if (c->tty.mouse_scrolling_flag)
848 if (m->statusat == 0 && y >= m->statuslines)
850 else if (m->statusat > 0 && y >= (u_int)m->statusat)
858 if (px > sx || py > sy)
865 if (wp == NULL)
870 if (where == PANE) {
873 } else if (where == BORDER)
875 else if (where == SCROLLBAR_UP ||
887 /* Stop dragging if needed. */
888 if (type != DRAG &&
893 if (c->tty.mouse_drag_release != NULL)
906 if (where == PANE)
908 if (where == STATUS)
910 if (where == STATUS_LEFT)
912 if (where == STATUS_RIGHT)
914 if (where == STATUS_DEFAULT)
916 if (where == SCROLLBAR_SLIDER)
918 if (where == BORDER)
922 if (where == PANE)
924 if (where == STATUS)
926 if (where == STATUS_LEFT)
928 if (where == STATUS_RIGHT)
930 if (where == STATUS_DEFAULT)
932 if (where == SCROLLBAR_SLIDER)
934 if (where == BORDER)
938 if (where == PANE)
940 if (where == STATUS)
942 if (where == STATUS_LEFT)
944 if (where == STATUS_RIGHT)
946 if (where == STATUS_DEFAULT)
948 if (where == SCROLLBAR_SLIDER)
950 if (where == BORDER)
954 if (where == PANE)
956 if (where == STATUS)
958 if (where == STATUS_LEFT)
960 if (where == STATUS_RIGHT)
962 if (where == STATUS_DEFAULT)
964 if (where == SCROLLBAR_SLIDER)
966 if (where == BORDER)
970 if (where == PANE)
972 if (where == STATUS)
974 if (where == STATUS_LEFT)
976 if (where == STATUS_RIGHT)
978 if (where == STATUS_DEFAULT)
980 if (where == SCROLLBAR_SLIDER)
982 if (where == BORDER)
986 if (where == PANE)
988 if (where == STATUS)
990 if (where == STATUS_LEFT)
992 if (where == STATUS_RIGHT)
994 if (where == STATUS_DEFAULT)
996 if (where == SCROLLBAR_SLIDER)
998 if (where == BORDER)
1002 if (where == PANE)
1004 if (where == STATUS)
1006 if (where == STATUS_LEFT)
1008 if (where == STATUS_RIGHT)
1010 if (where == STATUS_DEFAULT)
1012 if (where == SCROLLBAR_SLIDER)
1014 if (where == BORDER)
1018 if (where == PANE)
1020 if (where == STATUS)
1022 if (where == STATUS_LEFT)
1024 if (where == STATUS_RIGHT)
1026 if (where == STATUS_DEFAULT)
1028 if (where == SCROLLBAR_SLIDER)
1030 if (where == BORDER)
1034 if (where == PANE)
1036 if (where == STATUS)
1038 if (where == STATUS_LEFT)
1040 if (where == STATUS_RIGHT)
1042 if (where == STATUS_DEFAULT)
1044 if (where == SCROLLBAR_SLIDER)
1046 if (where == BORDER)
1064 if (where == PANE)
1066 if (where == STATUS)
1068 if (where == STATUS_LEFT)
1070 if (where == STATUS_RIGHT)
1072 if (where == STATUS_DEFAULT)
1074 if (where == BORDER)
1078 if (c->tty.mouse_drag_update != NULL)
1083 if (where == PANE)
1085 if (where == STATUS)
1087 if (where == STATUS_LEFT)
1089 if (where == STATUS_RIGHT)
1091 if (where == STATUS_DEFAULT)
1093 if (where == SCROLLBAR_UP)
1095 if (where == SCROLLBAR_SLIDER)
1097 if (where == SCROLLBAR_DOWN)
1099 if (where == BORDER)
1103 if (where == PANE)
1105 if (where == STATUS)
1107 if (where == STATUS_LEFT)
1109 if (where == STATUS_RIGHT)
1111 if (where == STATUS_DEFAULT)
1113 if (where == SCROLLBAR_UP)
1115 if (where == SCROLLBAR_SLIDER)
1117 if (where == SCROLLBAR_DOWN)
1119 if (where == BORDER)
1123 if (where == PANE)
1125 if (where == STATUS)
1127 if (where == STATUS_LEFT)
1129 if (where == STATUS_RIGHT)
1131 if (where == STATUS_DEFAULT)
1133 if (where == SCROLLBAR_UP)
1135 if (where == SCROLLBAR_SLIDER)
1137 if (where == SCROLLBAR_DOWN)
1139 if (where == BORDER)
1143 if (where == PANE)
1145 if (where == STATUS)
1147 if (where == STATUS_LEFT)
1149 if (where == STATUS_RIGHT)
1151 if (where == STATUS_DEFAULT)
1153 if (where == SCROLLBAR_UP)
1155 if (where == SCROLLBAR_SLIDER)
1157 if (where == SCROLLBAR_DOWN)
1159 if (where == BORDER)
1163 if (where == PANE)
1165 if (where == STATUS)
1167 if (where == STATUS_LEFT)
1169 if (where == STATUS_RIGHT)
1171 if (where == STATUS_DEFAULT)
1173 if (where == SCROLLBAR_UP)
1175 if (where == SCROLLBAR_SLIDER)
1177 if (where == SCROLLBAR_DOWN)
1179 if (where == BORDER)
1183 if (where == PANE)
1185 if (where == STATUS)
1187 if (where == STATUS_LEFT)
1189 if (where == STATUS_RIGHT)
1191 if (where == STATUS_DEFAULT)
1193 if (where == SCROLLBAR_UP)
1195 if (where == SCROLLBAR_SLIDER)
1197 if (where == SCROLLBAR_DOWN)
1199 if (where == BORDER)
1203 if (where == PANE)
1205 if (where == STATUS)
1207 if (where == STATUS_LEFT)
1209 if (where == STATUS_RIGHT)
1211 if (where == STATUS_DEFAULT)
1213 if (where == SCROLLBAR_UP)
1215 if (where == SCROLLBAR_SLIDER)
1217 if (where == SCROLLBAR_DOWN)
1219 if (where == BORDER)
1223 if (where == PANE)
1225 if (where == STATUS)
1227 if (where == STATUS_LEFT)
1229 if (where == STATUS_RIGHT)
1231 if (where == STATUS_DEFAULT)
1233 if (where == SCROLLBAR_UP)
1235 if (where == SCROLLBAR_SLIDER)
1237 if (where == SCROLLBAR_DOWN)
1239 if (where == BORDER)
1243 if (where == PANE)
1245 if (where == STATUS)
1247 if (where == STATUS_LEFT)
1249 if (where == STATUS_RIGHT)
1251 if (where == STATUS_DEFAULT)
1253 if (where == SCROLLBAR_UP)
1255 if (where == SCROLLBAR_SLIDER)
1257 if (where == SCROLLBAR_DOWN)
1259 if (where == BORDER)
1267 * corresponds to the mouse button in use. If starting to drag
1272 if (c->tty.mouse_scrolling_flag == 0 &&
1279 if (MOUSE_BUTTONS(b) == MOUSE_WHEEL_UP) {
1280 if (where == PANE)
1282 if (where == STATUS)
1284 if (where == STATUS_LEFT)
1286 if (where == STATUS_RIGHT)
1288 if (where == STATUS_DEFAULT)
1290 if (where == BORDER)
1293 if (where == PANE)
1295 if (where == STATUS)
1297 if (where == STATUS_LEFT)
1299 if (where == STATUS_RIGHT)
1301 if (where == STATUS_DEFAULT)
1303 if (where == BORDER)
1310 if (where == PANE)
1312 if (where == STATUS)
1314 if (where == STATUS_LEFT)
1316 if (where == STATUS_RIGHT)
1318 if (where == STATUS_DEFAULT)
1320 if (where == SCROLLBAR_UP)
1322 if (where == SCROLLBAR_SLIDER)
1324 if (where == SCROLLBAR_DOWN)
1326 if (where == BORDER)
1330 if (where == PANE)
1332 if (where == STATUS)
1334 if (where == STATUS_LEFT)
1336 if (where == STATUS_RIGHT)
1338 if (where == STATUS_DEFAULT)
1340 if (where == SCROLLBAR_UP)
1342 if (where == SCROLLBAR_SLIDER)
1344 if (where == SCROLLBAR_DOWN)
1346 if (where == BORDER)
1350 if (where == PANE)
1352 if (where == STATUS)
1354 if (where == STATUS_LEFT)
1356 if (where == STATUS_RIGHT)
1358 if (where == STATUS_DEFAULT)
1360 if (where == SCROLLBAR_UP)
1362 if (where == SCROLLBAR_SLIDER)
1364 if (where == SCROLLBAR_DOWN)
1366 if (where == BORDER)
1370 if (where == PANE)
1372 if (where == STATUS)
1374 if (where == STATUS_LEFT)
1376 if (where == STATUS_RIGHT)
1378 if (where == STATUS_DEFAULT)
1380 if (where == SCROLLBAR_UP)
1382 if (where == SCROLLBAR_SLIDER)
1384 if (where == SCROLLBAR_DOWN)
1386 if (where == BORDER)
1390 if (where == PANE)
1392 if (where == STATUS)
1394 if (where == STATUS_LEFT)
1396 if (where == STATUS_RIGHT)
1398 if (where == STATUS_DEFAULT)
1400 if (where == SCROLLBAR_UP)
1402 if (where == SCROLLBAR_SLIDER)
1404 if (where == SCROLLBAR_DOWN)
1406 if (where == BORDER)
1410 if (where == PANE)
1412 if (where == STATUS)
1414 if (where == STATUS_LEFT)
1416 if (where == STATUS_RIGHT)
1418 if (where == STATUS_DEFAULT)
1420 if (where == SCROLLBAR_UP)
1422 if (where == SCROLLBAR_SLIDER)
1424 if (where == SCROLLBAR_DOWN)
1426 if (where == BORDER)
1430 if (where == PANE)
1432 if (where == STATUS)
1434 if (where == STATUS_LEFT)
1436 if (where == STATUS_RIGHT)
1438 if (where == STATUS_DEFAULT)
1440 if (where == SCROLLBAR_UP)
1442 if (where == SCROLLBAR_SLIDER)
1444 if (where == SCROLLBAR_DOWN)
1446 if (where == BORDER)
1450 if (where == PANE)
1452 if (where == STATUS)
1454 if (where == STATUS_LEFT)
1456 if (where == STATUS_RIGHT)
1458 if (where == STATUS_DEFAULT)
1460 if (where == SCROLLBAR_UP)
1462 if (where == SCROLLBAR_SLIDER)
1464 if (where == SCROLLBAR_DOWN)
1466 if (where == BORDER)
1470 if (where == PANE)
1472 if (where == STATUS)
1474 if (where == STATUS_LEFT)
1476 if (where == STATUS_RIGHT)
1478 if (where == STATUS_DEFAULT)
1480 if (where == SCROLLBAR_UP)
1482 if (where == SCROLLBAR_SLIDER)
1484 if (where == SCROLLBAR_DOWN)
1486 if (where == BORDER)
1494 if (where == PANE)
1496 if (where == STATUS)
1498 if (where == STATUS_LEFT)
1500 if (where == STATUS_RIGHT)
1502 if (where == STATUS_DEFAULT)
1504 if (where == SCROLLBAR_UP)
1506 if (where == SCROLLBAR_SLIDER)
1508 if (where == SCROLLBAR_DOWN)
1510 if (where == BORDER)
1514 if (where == PANE)
1516 if (where == STATUS)
1518 if (where == STATUS_LEFT)
1520 if (where == STATUS_RIGHT)
1522 if (where == STATUS_DEFAULT)
1524 if (where == SCROLLBAR_UP)
1526 if (where == SCROLLBAR_SLIDER)
1528 if (where == SCROLLBAR_DOWN)
1530 if (where == BORDER)
1534 if (where == PANE)
1536 if (where == STATUS)
1538 if (where == STATUS_LEFT)
1540 if (where == STATUS_RIGHT)
1542 if (where == STATUS_DEFAULT)
1544 if (where == SCROLLBAR_UP)
1546 if (where == SCROLLBAR_SLIDER)
1548 if (where == SCROLLBAR_DOWN)
1550 if (where == BORDER)
1554 if (where == PANE)
1556 if (where == STATUS)
1558 if (where == STATUS_LEFT)
1560 if (where == STATUS_RIGHT)
1562 if (where == STATUS_DEFAULT)
1564 if (where == SCROLLBAR_UP)
1566 if (where == SCROLLBAR_SLIDER)
1568 if (where == SCROLLBAR_DOWN)
1570 if (where == BORDER)
1574 if (where == PANE)
1576 if (where == STATUS)
1578 if (where == STATUS_LEFT)
1580 if (where == STATUS_RIGHT)
1582 if (where == STATUS_DEFAULT)
1584 if (where == SCROLLBAR_UP)
1586 if (where == SCROLLBAR_SLIDER)
1588 if (where == SCROLLBAR_DOWN)
1590 if (where == BORDER)
1594 if (where == PANE)
1596 if (where == STATUS)
1598 if (where == STATUS_LEFT)
1600 if (where == STATUS_RIGHT)
1602 if (where == STATUS_DEFAULT)
1604 if (where == SCROLLBAR_UP)
1606 if (where == SCROLLBAR_SLIDER)
1608 if (where == SCROLLBAR_DOWN)
1610 if (where == BORDER)
1614 if (where == PANE)
1616 if (where == STATUS)
1618 if (where == STATUS_LEFT)
1620 if (where == STATUS_RIGHT)
1622 if (where == STATUS_DEFAULT)
1624 if (where == SCROLLBAR_UP)
1626 if (where == SCROLLBAR_SLIDER)
1628 if (where == SCROLLBAR_DOWN)
1630 if (where == BORDER)
1634 if (where == PANE)
1636 if (where == STATUS)
1638 if (where == STATUS_LEFT)
1640 if (where == STATUS_RIGHT)
1642 if (where == STATUS_DEFAULT)
1644 if (where == SCROLLBAR_UP)
1646 if (where == SCROLLBAR_SLIDER)
1648 if (where == SCROLLBAR_DOWN)
1650 if (where == BORDER)
1654 if (where == PANE)
1656 if (where == STATUS)
1658 if (where == STATUS_LEFT)
1660 if (where == STATUS_RIGHT)
1662 if (where == STATUS_DEFAULT)
1664 if (where == SCROLLBAR_UP)
1666 if (where == SCROLLBAR_SLIDER)
1668 if (where == SCROLLBAR_DOWN)
1670 if (where == BORDER)
1678 if (where == PANE)
1680 if (where == STATUS)
1682 if (where == STATUS_LEFT)
1684 if (where == STATUS_RIGHT)
1686 if (where == STATUS_DEFAULT)
1688 if (where == SCROLLBAR_UP)
1690 if (where == SCROLLBAR_SLIDER)
1692 if (where == SCROLLBAR_DOWN)
1694 if (where == BORDER)
1698 if (where == PANE)
1700 if (where == STATUS)
1702 if (where == STATUS_LEFT)
1704 if (where == STATUS_RIGHT)
1706 if (where == STATUS_DEFAULT)
1708 if (where == SCROLLBAR_UP)
1710 if (where == SCROLLBAR_SLIDER)
1712 if (where == SCROLLBAR_DOWN)
1714 if (where == BORDER)
1718 if (where == PANE)
1720 if (where == STATUS)
1722 if (where == STATUS_LEFT)
1724 if (where == STATUS_RIGHT)
1726 if (where == STATUS_DEFAULT)
1728 if (where == SCROLLBAR_UP)
1730 if (where == SCROLLBAR_SLIDER)
1732 if (where == SCROLLBAR_DOWN)
1734 if (where == BORDER)
1738 if (where == PANE)
1740 if (where == STATUS)
1742 if (where == STATUS_LEFT)
1744 if (where == STATUS_RIGHT)
1746 if (where == STATUS_DEFAULT)
1748 if (where == SCROLLBAR_UP)
1750 if (where == SCROLLBAR_SLIDER)
1752 if (where == SCROLLBAR_DOWN)
1754 if (where == BORDER)
1758 if (where == PANE)
1760 if (where == STATUS)
1762 if (where == STATUS_LEFT)
1764 if (where == STATUS_RIGHT)
1766 if (where == STATUS_DEFAULT)
1768 if (where == SCROLLBAR_UP)
1770 if (where == SCROLLBAR_SLIDER)
1772 if (where == SCROLLBAR_DOWN)
1774 if (where == BORDER)
1778 if (where == PANE)
1780 if (where == STATUS)
1782 if (where == STATUS_LEFT)
1784 if (where == STATUS_RIGHT)
1786 if (where == STATUS_DEFAULT)
1788 if (where == SCROLLBAR_UP)
1790 if (where == SCROLLBAR_SLIDER)
1792 if (where == SCROLLBAR_DOWN)
1794 if (where == BORDER)
1798 if (where == PANE)
1800 if (where == STATUS)
1802 if (where == STATUS_LEFT)
1804 if (where == STATUS_RIGHT)
1806 if (where == STATUS_DEFAULT)
1808 if (where == SCROLLBAR_UP)
1810 if (where == SCROLLBAR_SLIDER)
1812 if (where == SCROLLBAR_DOWN)
1814 if (where == BORDER)
1818 if (where == PANE)
1820 if (where == STATUS)
1822 if (where == STATUS_LEFT)
1824 if (where == STATUS_RIGHT)
1826 if (where == STATUS_DEFAULT)
1828 if (where == SCROLLBAR_UP)
1830 if (where == SCROLLBAR_SLIDER)
1832 if (where == SCROLLBAR_DOWN)
1834 if (where == BORDER)
1838 if (where == PANE)
1840 if (where == STATUS)
1842 if (where == STATUS_LEFT)
1844 if (where == STATUS_RIGHT)
1846 if (where == STATUS_DEFAULT)
1848 if (where == SCROLLBAR_UP)
1850 if (where == SCROLLBAR_SLIDER)
1852 if (where == SCROLLBAR_DOWN)
1854 if (where == BORDER)
1862 if (where == PANE)
1864 if (where == STATUS)
1866 if (where == STATUS_LEFT)
1868 if (where == STATUS_RIGHT)
1870 if (where == STATUS_DEFAULT)
1872 if (where == SCROLLBAR_UP)
1874 if (where == SCROLLBAR_SLIDER)
1876 if (where == SCROLLBAR_DOWN)
1878 if (where == BORDER)
1882 if (where == PANE)
1884 if (where == STATUS)
1886 if (where == STATUS_LEFT)
1888 if (where == STATUS_RIGHT)
1890 if (where == STATUS_DEFAULT)
1892 if (where == SCROLLBAR_UP)
1894 if (where == SCROLLBAR_SLIDER)
1896 if (where == SCROLLBAR_DOWN)
1898 if (where == BORDER)
1902 if (where == PANE)
1904 if (where == STATUS)
1906 if (where == STATUS_LEFT)
1908 if (where == STATUS_RIGHT)
1910 if (where == STATUS_DEFAULT)
1912 if (where == SCROLLBAR_UP)
1914 if (where == SCROLLBAR_SLIDER)
1916 if (where == SCROLLBAR_DOWN)
1918 if (where == BORDER)
1922 if (where == PANE)
1924 if (where == STATUS)
1926 if (where == STATUS_LEFT)
1928 if (where == STATUS_RIGHT)
1930 if (where == STATUS_DEFAULT)
1932 if (where == SCROLLBAR_UP)
1934 if (where == SCROLLBAR_SLIDER)
1936 if (where == SCROLLBAR_DOWN)
1938 if (where == BORDER)
1942 if (where == PANE)
1944 if (where == STATUS)
1946 if (where == STATUS_LEFT)
1948 if (where == STATUS_RIGHT)
1950 if (where == STATUS_DEFAULT)
1952 if (where == SCROLLBAR_UP)
1954 if (where == SCROLLBAR_SLIDER)
1956 if (where == SCROLLBAR_DOWN)
1958 if (where == BORDER)
1962 if (where == PANE)
1964 if (where == STATUS)
1966 if (where == STATUS_LEFT)
1968 if (where == STATUS_RIGHT)
1970 if (where == STATUS_DEFAULT)
1972 if (where == SCROLLBAR_UP)
1974 if (where == SCROLLBAR_SLIDER)
1976 if (where == SCROLLBAR_DOWN)
1978 if (where == BORDER)
1982 if (where == PANE)
1984 if (where == STATUS)
1986 if (where == STATUS_LEFT)
1988 if (where == STATUS_RIGHT)
1990 if (where == STATUS_DEFAULT)
1992 if (where == SCROLLBAR_UP)
1994 if (where == SCROLLBAR_SLIDER)
1996 if (where == SCROLLBAR_DOWN)
1998 if (where == BORDER)
2002 if (where == PANE)
2004 if (where == STATUS)
2006 if (where == STATUS_LEFT)
2008 if (where == STATUS_RIGHT)
2010 if (where == STATUS_DEFAULT)
2012 if (where == SCROLLBAR_UP)
2014 if (where == SCROLLBAR_SLIDER)
2016 if (where == SCROLLBAR_DOWN)
2018 if (where == BORDER)
2022 if (where == PANE)
2024 if (where == STATUS)
2026 if (where == STATUS_LEFT)
2028 if (where == STATUS_RIGHT)
2030 if (where == STATUS_DEFAULT)
2032 if (where == SCROLLBAR_UP)
2034 if (where == SCROLLBAR_SLIDER)
2036 if (where == SCROLLBAR_DOWN)
2038 if (where == BORDER)
2046 if (where == PANE)
2048 if (where == STATUS)
2050 if (where == STATUS_LEFT)
2052 if (where == STATUS_RIGHT)
2054 if (where == STATUS_DEFAULT)
2056 if (where == SCROLLBAR_UP)
2058 if (where == SCROLLBAR_SLIDER)
2060 if (where == SCROLLBAR_DOWN)
2062 if (where == BORDER)
2066 if (where == PANE)
2068 if (where == STATUS)
2070 if (where == STATUS_LEFT)
2072 if (where == STATUS_RIGHT)
2074 if (where == STATUS_DEFAULT)
2076 if (where == SCROLLBAR_UP)
2078 if (where == SCROLLBAR_SLIDER)
2080 if (where == SCROLLBAR_DOWN)
2082 if (where == BORDER)
2086 if (where == PANE)
2088 if (where == STATUS)
2090 if (where == STATUS_LEFT)
2092 if (where == STATUS_RIGHT)
2094 if (where == STATUS_DEFAULT)
2096 if (where == SCROLLBAR_UP)
2098 if (where == SCROLLBAR_SLIDER)
2100 if (where == SCROLLBAR_DOWN)
2102 if (where == BORDER)
2106 if (where == PANE)
2108 if (where == STATUS)
2110 if (where == STATUS_LEFT)
2112 if (where == STATUS_RIGHT)
2114 if (where == STATUS_DEFAULT)
2116 if (where == SCROLLBAR_UP)
2118 if (where == SCROLLBAR_SLIDER)
2120 if (where == SCROLLBAR_DOWN)
2122 if (where == BORDER)
2126 if (where == PANE)
2128 if (where == STATUS)
2130 if (where == STATUS_LEFT)
2132 if (where == STATUS_RIGHT)
2134 if (where == STATUS_DEFAULT)
2136 if (where == SCROLLBAR_UP)
2138 if (where == SCROLLBAR_SLIDER)
2140 if (where == SCROLLBAR_DOWN)
2142 if (where == BORDER)
2146 if (where == PANE)
2148 if (where == STATUS)
2150 if (where == STATUS_LEFT)
2152 if (where == STATUS_RIGHT)
2154 if (where == STATUS_DEFAULT)
2156 if (where == SCROLLBAR_UP)
2158 if (where == SCROLLBAR_SLIDER)
2160 if (where == SCROLLBAR_DOWN)
2162 if (where == BORDER)
2166 if (where == PANE)
2168 if (where == STATUS)
2170 if (where == STATUS_LEFT)
2172 if (where == STATUS_RIGHT)
2174 if (where == STATUS_DEFAULT)
2176 if (where == SCROLLBAR_UP)
2178 if (where == SCROLLBAR_SLIDER)
2180 if (where == SCROLLBAR_DOWN)
2182 if (where == BORDER)
2186 if (where == PANE)
2188 if (where == STATUS)
2190 if (where == STATUS_LEFT)
2192 if (where == STATUS_RIGHT)
2194 if (where == STATUS_DEFAULT)
2196 if (where == SCROLLBAR_UP)
2198 if (where == SCROLLBAR_SLIDER)
2200 if (where == SCROLLBAR_DOWN)
2202 if (where == BORDER)
2206 if (where == PANE)
2208 if (where == STATUS)
2210 if (where == STATUS_LEFT)
2212 if (where == STATUS_RIGHT)
2214 if (where == STATUS_DEFAULT)
2216 if (where == SCROLLBAR_UP)
2218 if (where == SCROLLBAR_SLIDER)
2220 if (where == SCROLLBAR_DOWN)
2222 if (where == BORDER)
2228 if (key == KEYC_UNKNOWN)
2232 /* Apply modifiers if any. */
2233 if (b & MOUSE_MASK_META)
2235 if (b & MOUSE_MASK_CTRL)
2237 if (b & MOUSE_MASK_SHIFT)
2240 if (log_get_level() != 0)
2249 if (key == KEYC_PASTE_START) {
2255 if (key == KEYC_PASTE_END) {
2272 if (c->flags & CLIENT_BRACKETPASTING)
2274 if ((t = options_get_number(s->options, "assume-paste-time")) == 0)
2278 if (tv.tv_sec == 0 && tv.tv_usec < t * 1000) {
2279 if (c->flags & CLIENT_ASSUMEPASTING)
2285 if (c->flags & CLIENT_ASSUMEPASTING) {
2298 if (c->session == NULL)
2302 if (w->latest == c)
2306 if (options_get_number(w->options, "window-size") == WINDOW_SIZE_LATEST)
2319 if (~bd->flags & KEY_BINDING_REPEAT)
2322 if (repeat == 0)
2324 if ((~c->flags & CLIENT_REPEAT) || bd->key != c->last_key) {
2326 if (initial != 0)
2356 if (s == NULL || (c->flags & CLIENT_UNATTACHEDFLAGS))
2363 if (gettimeofday(&c->activity_time, NULL) != 0)
2369 if (key == KEYC_MOUSE || key == KEYC_DOUBLECLICK) {
2370 if (c->flags & CLIENT_READONLY)
2373 if (key == KEYC_UNKNOWN)
2383 if ((key & KEYC_MASK_KEY) == KEYC_DRAGGING) {
2391 if (!KEYC_IS_MOUSE(key) || cmd_find_from_mouse(&fs, m, 0) != 0)
2395 /* Forward mouse keys if disabled. */
2396 if (KEYC_IS_MOUSE(key) && !options_get_number(s->options, "mouse"))
2399 /* Forward if bracket pasting. */
2400 if (server_client_is_bracket_paste (c, key))
2404 if (!KEYC_IS_MOUSE(key) &&
2412 * Work out the current key table. If the pane is in a mode, use
2415 if (server_client_is_default_key_table(c, c->keytable) &&
2432 if ((key0 == (prefix & (KEYC_MASK_KEY|KEYC_MASK_MODIFIERS)) ||
2443 if (wp == NULL)
2447 if (c->flags & CLIENT_REPEAT)
2453 * If prefix-timeout is enabled and we're in the prefix table, see if
2454 * the timeout has been exceeded. Revert to the root table if so.
2457 if (prefix_delay > 0 &&
2461 * If repeating is active and this is a repeating binding,
2464 if (bd != NULL &&
2477 /* Try to see if there is a key binding in the current table. */
2478 if (bd != NULL) {
2480 * Key was matched in this table. If currently repeating but a
2484 if ((c->flags & CLIENT_REPEAT) &&
2503 * If this is a repeating key, start the timer. Otherwise reset
2507 if (repeat != 0) {
2530 if (key0 != KEYC_ANY) {
2539 if (key == KEYC_MOUSEMOVE_PANE ||
2548 * No match in this table. If not in the root table or if repeating
2552 if (!server_client_is_default_key_table(c, table) ||
2557 if (c->flags & CLIENT_REPEAT)
2565 * No match in the root table either. If this wasn't the first table
2568 if (first != table && (~flags & CLIENT_REPEAT)) {
2575 if (c->flags & CLIENT_READONLY)
2577 if (wp != NULL)
2582 if (c->flags & CLIENT_READONLY)
2584 if (event->buf != NULL)
2590 if (s != NULL && key != KEYC_FOCUS_OUT)
2605 if (s == NULL || (c->flags & CLIENT_UNATTACHEDFLAGS))
2613 if (~c->flags & CLIENT_READONLY) {
2614 if (c->message_string != NULL) {
2615 if (c->message_ignore_keys)
2619 if (c->overlay_key != NULL) {
2629 if (c->prompt_string != NULL) {
2630 if (status_prompt_key(c, event->key) == 0)
2659 if (c->session != NULL) {
2672 if (wp->fd != -1) {
2682 /* Check if window needs to be resized. */
2688 if (~w->flags & WINDOW_RESIZE)
2692 if (wl->session->attached != 0 && wl->session->curw == wl)
2695 if (wl == NULL)
2712 /* Check if pane should be resized. */
2722 if (TAILQ_EMPTY(&wp->resize_queue))
2725 if (!event_initialized(&wp->resize_timer))
2727 if (evtimer_pending(&wp->resize_timer, NULL))
2751 if (first == last) {
2756 } else if (last->sx != first->osx || last->sy != first->osy) {
2774 if (r == last)
2801 if (wp->pipe_fd != -1 && wp->pipe_offset.used < minimum)
2804 if (c->session == NULL)
2808 if (~c->flags & CLIENT_CONTROL) {
2813 if (wpo == NULL) {
2814 if (!flag)
2818 if (!flag)
2825 if (wpo->used < minimum)
2828 if (attached_clients == 0)
2831 if (minimum == 0)
2840 * Adjust the base offset. If it would roll over, all the offsets into
2843 if (wp->base_offset > SIZE_MAX - minimum) {
2846 if (wp->pipe_fd != -1)
2849 if (c->session == NULL || (~c->flags & CLIENT_CONTROL))
2852 if (wpo != NULL && !flag)
2861 * If there is data remaining, and there are no clients able to consume
2867 if (off)
2893 if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
2900 /* Get mode from overlay if any, else from screen. */
2901 if (c->overlay_draw != NULL) {
2902 if (c->overlay_mode != NULL)
2904 } else if (c->prompt_string == NULL)
2908 if (s != NULL)
2910 if (log_get_level() != 0) {
2920 if (c->prompt_string != NULL) {
2922 if (n == 0)
2926 if (n == 0)
2932 } else if (c->overlay_draw == NULL) {
2935 if (wp->xoff + s->cx >= ox && wp->xoff + s->cx <= ox + sx &&
2942 if (status_at_line(c) == 0)
2945 if (!cursor)
2952 * Set mouse mode if requested. To support dragging, always use button
2955 if (options_get_number(oo, "mouse")) {
2956 if (c->overlay_draw == NULL) {
2959 if (loop->screen->mode & MODE_MOUSE_ALL)
2963 if (~mode & MODE_MOUSE_ALL)
2967 /* Clear bracketed paste mode if at the prompt. */
2968 if (c->overlay_draw == NULL && c->prompt_string != NULL)
2975 /* All writing must be done, send a sync end (if it was started). */
2986 if (c->flags & CLIENT_REPEAT) {
3002 if (c->flags & CLIENT_TRIPLECLICK) {
3010 if (!server_client_handle_key(c, event)) {
3018 /* Check if client should be exited. */
3027 if (c->flags & (CLIENT_DEAD|CLIENT_EXITED))
3029 if (~c->flags & CLIENT_EXIT)
3032 if (c->flags & CLIENT_CONTROL) {
3034 if (!control_all_done(c))
3038 if (EVBUFFER_LENGTH(cf->buffer) != 0)
3045 if (c->exit_message != NULL)
3052 if (c->exit_message != NULL)
3077 * Check if modes need to be updated. Only modes in the current window are
3087 if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
3089 if (~c->flags & CLIENT_REDRAWSTATUS)
3093 if (wme != NULL && wme->mode->update != NULL)
3114 if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
3116 if (c->flags & CLIENT_ALLREDRAWFLAGS) {
3127 * If there is outstanding data, defer the redraw until it has been
3132 if (c->flags & CLIENT_ALLREDRAWFLAGS)
3136 if (wp->flags & PANE_REDRAW) {
3141 if (wp->flags & PANE_REDRAWSCROLLBAR) {
3148 if (needed && (left = EVBUFFER_LENGTH(tty->out)) != 0) {
3150 if (!evtimer_initialized(&ev))
3152 if (!evtimer_pending(&ev, NULL)) {
3157 if (~c->flags & CLIENT_REDRAWWINDOW) {
3159 if (wp->flags & (PANE_REDRAW)) {
3163 } else if (wp->flags & PANE_REDRAWSCROLLBAR) {
3168 if (++bit == 64) {
3170 * If more that 64 panes, give up and
3179 if (c->redraw_panes != 0)
3181 if (c->redraw_scrollbars != 0)
3186 } else if (needed)
3192 if (~c->flags & CLIENT_REDRAWWINDOW) {
3194 * If not redrawing the entire window, check whether each pane
3200 if (wp->flags & PANE_REDRAW)
3202 else if (c->flags & CLIENT_REDRAWPANES) {
3203 if (c->redraw_panes & (1 << bit))
3205 } else if (c->flags & CLIENT_REDRAWSCROLLBARS) {
3206 if (c->redraw_scrollbars & (1 << bit))
3210 if (!redraw_pane && !redraw_scrollbar_only)
3212 if (redraw_scrollbar_only) {
3226 if (c->flags & CLIENT_ALLREDRAWFLAGS) {
3227 if (options_get_number(s->options, "set-titles")) {
3241 if (needed) {
3267 if (c->title == NULL || strcmp(title, c->title) != 0) {
3284 if (s->curw == NULL)
3286 if (s->curw->window->active->base.path == NULL)
3290 if (c->path == NULL || strcmp(path, c->path) != 0) {
3305 if (c->flags & CLIENT_DEAD)
3308 if (imsg == NULL) {
3334 if (datalen != 0)
3337 if (c->flags & CLIENT_CONTROL)
3343 if (c->overlay_resize == NULL)
3348 if (c->session != NULL)
3352 if (datalen != 0)
3361 if (datalen != 0)
3364 if (!(c->flags & CLIENT_SUSPENDED))
3368 if (c->fd == -1 || c->session == NULL) /* exited already */
3372 if (gettimeofday(&c->activity_time, NULL) != 0)
3379 if (s != NULL)
3383 if (datalen != 0)
3414 if (~c->flags & CLIENT_ATTACHED)
3416 else if (~c->flags & CLIENT_EXIT) {
3417 if (c->flags & CLIENT_CONTROL)
3437 if (c->flags & CLIENT_EXIT)
3440 if (imsg->hdr.len - IMSG_HEADER_SIZE < sizeof data)
3446 if (len > 0 && buf[len - 1] != '\0')
3450 if (cmd_unpack_argv(buf, len, argc, &argv) != 0) {
3455 if (argc == 0) {
3474 if ((c->flags & CLIENT_READONLY) &&
3504 if (c->flags & CLIENT_IDENTIFIED)
3512 if (datalen != sizeof feat)
3520 if (datalen != sizeof flags)
3527 if (datalen != sizeof longflags)
3535 if (datalen == 0 || data[datalen - 1] != '\0')
3537 if (*data == '\0')
3544 if (datalen == 0 || data[datalen - 1] != '\0')
3552 if (datalen == 0 || data[datalen - 1] != '\0')
3558 if (datalen == 0 || data[datalen - 1] != '\0')
3560 if (access(data, X_OK) == 0)
3562 else if ((home = find_home()) != NULL)
3569 if (datalen != 0)
3575 if (datalen != 0)
3581 if (datalen == 0 || data[datalen - 1] != '\0')
3583 if (strchr(data, '=') != NULL)
3588 if (datalen != sizeof c->pid)
3597 if (imsg->hdr.type != MSG_IDENTIFY_DONE)
3601 if (*c->ttyname != '\0')
3608 if (c->flags & CLIENT_CONTROL)
3610 else if (c->fd != -1) {
3611 if (tty_init(&c->tty, c) != 0) {
3623 * If this is the first client, load configuration files. Any later
3624 * clients are allowed to continue with their command even if the
3627 if ((~c->flags & CLIENT_EXIT) &&
3640 if (!checkshell(shell))
3653 if (!cfg_finished && cfg_client != NULL)
3655 if (c != NULL && c->session == NULL && c->cwd != NULL)
3657 if (s != NULL && s->cwd != NULL)
3659 if (c != NULL && (s = c->session) != NULL && s->cwd != NULL)
3661 if ((home = find_home()) != NULL)
3670 if (strcmp(next, "pause-after") == 0) {
3674 if (sscanf(next, "pause-after=%u", &c->pause_age) == 1) {
3678 if (strcmp(next, "no-output") == 0)
3680 if (strcmp(next, "wait-exit") == 0)
3696 if (not)
3699 if (c->flags & CLIENT_CONTROL)
3703 if (strcmp(next, "read-only") == 0)
3705 else if (strcmp(next, "ignore-size") == 0)
3707 else if (strcmp(next, "active-pane") == 0)
3709 else if (strcmp(next, "no-detach-on-destroy") == 0)
3711 if (flag == 0)
3715 if (not) {
3716 if (c->flags & CLIENT_READONLY)
3721 if (flag == CLIENT_CONTROL_NOOUTPUT)
3736 if (c->flags & CLIENT_ATTACHED)
3738 if (c->flags & CLIENT_FOCUSED)
3740 if (c->flags & CLIENT_CONTROL)
3742 if (c->flags & CLIENT_IGNORESIZE)
3744 if (c->flags & CLIENT_NO_DETACH_ON_DESTROY)
3746 if (c->flags & CLIENT_CONTROL_NOOUTPUT)
3748 if (c->flags & CLIENT_CONTROL_WAITEXIT)
3750 if (c->flags & CLIENT_CONTROL_PAUSEAFTER) {
3755 if (c->flags & CLIENT_READONLY)
3757 if (c->flags & CLIENT_ACTIVEPANE)
3759 if (c->flags & CLIENT_SUSPENDED)
3761 if (c->flags & CLIENT_UTF8)
3763 if (*s != '\0')
3784 if (cw == NULL) {
3799 if (s == NULL)
3802 if (~c->flags & CLIENT_ACTIVEPANE)
3805 if (cw == NULL)
3817 if (s == NULL)
3835 if (cw != NULL && cw->pane == wp) {
3852 if (!parse) {
3856 if (size == 0)
3860 if (msg[size - 1] != '\0')
3866 if (c == NULL)
3869 if (c->session == NULL || (c->flags & CLIENT_CONTROL)) {
3870 if (~c->flags & CLIENT_UTF8) {
3872 if (c->flags & CLIENT_CONTROL)
3878 if (c->flags & CLIENT_CONTROL)
3888 if (wme == NULL || wme->mode != &window_view_mode)
3890 if (parse) {
3893 if (line != NULL) {
3900 if (size != 0) {
3908 if (!parse)