Skip to content

Commit

Permalink
GUACAMOLE-192: Select word in terminal on double click
Browse files Browse the repository at this point in the history
  • Loading branch information
corentin-soriano committed Apr 15, 2024
1 parent 2608e11 commit 0bdcbba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/terminal/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2259,10 +2259,13 @@ bool guac_terminal_is_part_of_word(int ascii_char) {
if ((ascii_char >= GUAC_TERMINAL_ASCII_0 && ascii_char <= GUAC_TERMINAL_ASCII_9) ||
(ascii_char >= GUAC_TERMINAL_ASCII_A && ascii_char <= GUAC_TERMINAL_ASCII_Z) ||
(ascii_char >= GUAC_TERMINAL_ASCII_a && ascii_char <= GUAC_TERMINAL_ASCII_z) ||
(ascii_char == GUAC_TERMINAL_ASCII_PERCENT) ||
(ascii_char == GUAC_TERMINAL_ASCII_AMPERSAND) ||
(ascii_char == GUAC_TERMINAL_ASCII_MINUS) ||
(ascii_char == GUAC_TERMINAL_ASCII_DOT) ||
(ascii_char == GUAC_TERMINAL_ASCII_SLASH) ||
(ascii_char == GUAC_TERMINAL_ASCII_COLON) ||
(ascii_char == GUAC_TERMINAL_ASCII_EQUAL) ||
(ascii_char == GUAC_TERMINAL_ASCII_QUESTION_MARK) ||
(ascii_char == GUAC_TERMINAL_ASCII_BACKSLASH) ||
(ascii_char == GUAC_TERMINAL_ASCII_UDL) ||
Expand Down
15 changes: 15 additions & 0 deletions src/terminal/terminal/terminal-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ typedef int guac_terminal_char_handler(guac_terminal* term, unsigned char c);
*/
#define GUAC_TERMINAL_ASCII_SPACE 32

/**
* The ASCII number of %
*/
#define GUAC_TERMINAL_ASCII_PERCENT 37

/**
* The ASCII number of &
*/
Expand Down Expand Up @@ -84,6 +89,16 @@ typedef int guac_terminal_char_handler(guac_terminal* term, unsigned char c);
*/
#define GUAC_TERMINAL_ASCII_9 57

/**
* The ASCII number of :
*/
#define GUAC_TERMINAL_ASCII_COLON 58

/**
* The ASCII number of =
*/
#define GUAC_TERMINAL_ASCII_EQUAL 61

/**
* The ASCII number of ?
*/
Expand Down

0 comments on commit 0bdcbba

Please sign in to comment.