1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-26 02:46:13 -04:00

get_clipboard_text: Disable pasting from GNU Screen's clipboard.

This commit is contained in:
Kalle Olavi Niemitalo 2007-02-11 20:56:41 +02:00 committed by Kalle Olavi Niemitalo
parent 3caec64c51
commit 763f03f146
2 changed files with 23 additions and 2 deletions

4
NEWS
View File

@ -34,7 +34,6 @@ roughly in decreasing order of importance.
- (enhancement) Reject invalid UTF-8 input from documents and
terminals.
* Changes in terminal support
- (new feature) Support for pasting from GNU screen clipboard
- (enhancement) Make ELinks FreeBSD friendly. Defined keys used on
FreeBSD console
- (enhancement) Mouse wheel support on BSD via moused -z 4
@ -72,7 +71,7 @@ roughly in decreasing order of importance.
- (enhancement 887) Save in cookie manager should save cookies even
if unmodified.
* Changes in the user interface
- (new feature) Internal clipboard support
- (new feature 145) Internal clipboard support
- (enhancement) Place the cursor on the current listbox item, to
help screen readers
- (enhancement) Localization updates
@ -270,6 +269,7 @@ have already been considered.
- (new feature) Let plain text change colors with ESC [ 31 m or
similar control sequences, reverted in
2a6125e3d0407b588eb286d4d0ff5c98c23ebda9
- (enhancement) Support for pasting from GNU screen clipboard
* Unimportant changes:
- (enhancement) If select fails, save its errno.

View File

@ -349,6 +349,26 @@ static unsigned char *clipboard;
unsigned char *
get_clipboard_text(void)
{
/* The following support for GNU Screen's clipboard is
* disabled for two reasons:
*
* 1. It does not actually return the string from that
* clipboard, but rather causes the clipboard contents to
* appear in stdin. get_clipboard_text is normally called
* because the user pressed a Paste key in an input field,
* so the characters end up being inserted in that field;
* but if there are newlines in the clipboard, then the
* field may lose focus, in which case the remaining
* characters may trigger arbitrary actions in ELinks.
*
* 2. It pastes from both GNU Screen's clipboard and the ELinks
* internal clipboard. Because set_clipboard_text also sets
* them both, the same text would typically get pasted twice.
*
* Users can instead use the GNU Screen key bindings to run the
* paste command. This method still suffers from problem 1 but
* any user of GNU Screen should know that already. */
#if 0
/* GNU Screen's clipboard */
if (is_gnuscreen()) {
struct string str;
@ -359,6 +379,7 @@ get_clipboard_text(void)
if (str.length) exe(str.source);
if (str.source) done_string(&str);
}
#endif
return stracpy(empty_string_or_(clipboard));
}