Re: vte widget improvement idea

2015-07-25 Thread Bernhard Schuster
The most sane thing would probably to treat the whole content of the paste
as single command which implicitly means ignoring newlines or escaping
them. The user can then ack the whole array of commands by a single enter
key press.

I find the idea in general pretty good.

On Thu, Jun 11, 2015, 10:17 PM Gergely Polonkai gerg...@polonkai.eu wrote:

 I don't think it is a bad idea per se. Here are some ideas from me:

 • it should be either turned off by default
 • or it should warn the user like »hey, you are going to paste multiple
 lines, are you sure?« with an option to silence such warnings

 Also I remember a warning, maybe from ViM that warned me about such an
 occasion. This means that the terminal has some knowledge on this.
 On 11 Jun 2015 19:13, Wouter Verhelst w...@uter.be wrote:

  On Thu, Jun 11, 2015 at 06:55:13PM +0300, Martin Kunev wrote:
  [...]
   My idea is to add a setting (something like
   vte_terminal_set_paste_escape()) that, when turned on, escapes the
   dangerous characters (unquoted line feeds) from the clipboard text and
  then
   pastes.
  [...]
   Any thoughts on this feature? Do you think this is a good idea? Any
   suggestions?
 
  To be honest, I think that's a terrible idea.
 
  You're assuming that pasting something into a shell is always a bad
  idea. It is if you did it by accident, but if you do it on purpose, it
  isn't.
 
  If I mail my customer to please paste these two commands from their mail
  into a shell window, I don't want to have to tell them to switch off
  this protection first.
 
  If I have a web page with documentation which says that to create a new
  user, first run adduser usxername, and then run passwd username, I
  don't want to have to tack on but you can't paste that in the shell
  window.
 
  There are plenty of valid uses for pasting something into a terminal
  window. Let's not throw the kid out with the bath water.
 
  --
  It is easy to love a country that is famous for chocolate and beer
 
-- Barack Obama, speaking in Brussels, Belgium, 2014-03-26
  ___
  gtk-app-devel-list mailing list
  gtk-app-devel-list@gnome.org
  https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

vte widget improvement idea

2015-06-11 Thread Martin Kunev
Hi

I'm not sure this is the right place to ask this. I want to implement a new
feature for the vte widget so I am interested to hear the opinion of other
people about this.

Sometimes I think I have something in the clipboard and paste it into the
terminal just to realize I had something else (which is multiline). This
can be dangerous. Also, it is not clear what will happen when pasting
something copied from a website and it's cumbersome to check the clipboard
every time.
Both these problems can be avoided with user discipline but I believe there
should be a way to reduce the possibility of making such mistakes.

My idea is to add a setting (something like
vte_terminal_set_paste_escape()) that, when turned on, escapes the
dangerous characters (unquoted line feeds) from the clipboard text and then
pastes.

After some thinking I am no longer sure if implementing this will be easy
(or even possible).
What I see as a problem is that the widget has to know if the pasted text
goes to the shell or something else (e.g. text editor). One possible
solution is to see whether the foreground process group of the terminal is
the one of the starte
d shell (this can be obtained with tcgetpgrp()).

Any thoughts on this feature? Do you think this is a good idea? Any
suggestions?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: vte widget improvement idea

2015-06-11 Thread Wouter Verhelst
On Thu, Jun 11, 2015 at 06:55:13PM +0300, Martin Kunev wrote:
[...]
 My idea is to add a setting (something like
 vte_terminal_set_paste_escape()) that, when turned on, escapes the
 dangerous characters (unquoted line feeds) from the clipboard text and then
 pastes.
[...]
 Any thoughts on this feature? Do you think this is a good idea? Any
 suggestions?

To be honest, I think that's a terrible idea.

You're assuming that pasting something into a shell is always a bad
idea. It is if you did it by accident, but if you do it on purpose, it
isn't.

If I mail my customer to please paste these two commands from their mail
into a shell window, I don't want to have to tell them to switch off
this protection first.

If I have a web page with documentation which says that to create a new
user, first run adduser usxername, and then run passwd username, I
don't want to have to tack on but you can't paste that in the shell
window.

There are plenty of valid uses for pasting something into a terminal
window. Let's not throw the kid out with the bath water.

-- 
It is easy to love a country that is famous for chocolate and beer

  -- Barack Obama, speaking in Brussels, Belgium, 2014-03-26
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: vte widget improvement idea

2015-06-11 Thread Gergely Polonkai
I don't think it is a bad idea per se. Here are some ideas from me:

• it should be either turned off by default
• or it should warn the user like »hey, you are going to paste multiple
lines, are you sure?« with an option to silence such warnings

Also I remember a warning, maybe from ViM that warned me about such an
occasion. This means that the terminal has some knowledge on this.
On 11 Jun 2015 19:13, Wouter Verhelst w...@uter.be wrote:

 On Thu, Jun 11, 2015 at 06:55:13PM +0300, Martin Kunev wrote:
 [...]
  My idea is to add a setting (something like
  vte_terminal_set_paste_escape()) that, when turned on, escapes the
  dangerous characters (unquoted line feeds) from the clipboard text and
 then
  pastes.
 [...]
  Any thoughts on this feature? Do you think this is a good idea? Any
  suggestions?

 To be honest, I think that's a terrible idea.

 You're assuming that pasting something into a shell is always a bad
 idea. It is if you did it by accident, but if you do it on purpose, it
 isn't.

 If I mail my customer to please paste these two commands from their mail
 into a shell window, I don't want to have to tell them to switch off
 this protection first.

 If I have a web page with documentation which says that to create a new
 user, first run adduser usxername, and then run passwd username, I
 don't want to have to tack on but you can't paste that in the shell
 window.

 There are plenty of valid uses for pasting something into a terminal
 window. Let's not throw the kid out with the bath water.

 --
 It is easy to love a country that is famous for chocolate and beer

   -- Barack Obama, speaking in Brussels, Belgium, 2014-03-26
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list