Recent

Author Topic: Terminal Component Available  (Read 16011 times)

guest58172

  • Guest
Re: Terminal Component Available
« Reply #30 on: April 22, 2018, 04:20:53 pm »
Well "easy" was right for linux... on Windows encoding is a mess.
- cmd.exe /U: i manage to display output of MS tools with MBC but then the foreign tools, e.g git are not displayed correctly.
- cmd.exe /K chcp 65001: MS tools output with MBC not displayed correctly but foreign tools ok.

will push to repo if someone wants to give a hand...

Thaddy

  • Hero Member
  • *****
  • Posts: 14367
  • Sensorship about opinions does not belong here.
Re: Terminal Component Available
« Reply #31 on: April 22, 2018, 04:32:48 pm »
What is wrong with that? One is explicitly UTF16 and the other explicitly UTF8.... MS is UTF16, not UTF8...Exrernal tools at fault here...
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

bobihot

  • New Member
  • *
  • Posts: 36
Re: Terminal Component Available
« Reply #32 on: August 24, 2018, 05:32:08 pm »
Me very need like this, at this time for windows. Are easy to I make changes- where?

stem

  • Jr. Member
  • **
  • Posts: 88
Re: Terminal Component Available
« Reply #33 on: March 24, 2019, 09:16:52 pm »
Thank you for the component!

Is it possible to send commands to the terminal?

stem

clayrm

  • Newbie
  • Posts: 1
Re: Terminal Component Available
« Reply #34 on: September 24, 2019, 11:56:16 am »
Install error:
Warning: svn not in path.
how to fix the error?
Many thanks

philtroy

  • Newbie
  • Posts: 3
Re: Terminal Component Available
« Reply #35 on: October 03, 2019, 07:05:40 am »
Hi

How would I go about modifying terminal component to make it possible to programmatically send a command to the terminal component and to have the terminal component execute it?

I am guessing it would involve exposing vte_pty_spawn_async () (https://developer.gnome.org/vte/unstable/vte-Vte-PTY.html#vte-pty-spawn-async) but I am not sure I know how to do that exactly and also I am not sure what parameters to pass.  Alternatively, I think I saw a feed method that could be used as well.

Phil Troy




bytebites

  • Hero Member
  • *****
  • Posts: 640
Re: Terminal Component Available
« Reply #36 on: October 03, 2019, 03:15:55 pm »
Nice component. Should this add to th OPM?

To insert text to the console:
GTK2Term.pas file changes
Code: Pascal  [Select][+][-]
  1. ***************
  2. *** 51,56 ****
  3. --- 51,57 ----
  4.  
  5.   var
  6.     vte_terminal_new: function: PGtkWidget; cdecl;
  7. +   vte_terminal_feed_child : function(terminal: PVteTerminal; str:pchar;size:gssize):gboolean; cdecl;
  8.     vte_terminal_fork_command_full: function(terminal: PVteTerminal; pty_flags: TVtePtyFlags;
  9.       working_directory: PChar; argv, envv: PPChar; spawn_flags: TGSpawnFlags;
  10.       child_setup: TGSpawnChildSetupFunc; child_setup_data: Pointer; child_pid:
  11. ***************
  12. *** 77,82 ****
  13. --- 78,84 ----
  14.     if Lib = 0 then
  15.       Exit(Loaded);
  16.     @vte_terminal_new := GetProcAddress(Lib, 'vte_terminal_new');
  17. +   @vte_terminal_feed_child := GetProcAddress(Lib, 'vte_terminal_feed_child');
  18.     @vte_terminal_fork_command_full := GetProcAddress(Lib, 'vte_terminal_fork_command_full');
  19.     Loaded :=
  20.       (@vte_terminal_new <> nil) and

Add this procedure to Terminalctrls.pas-file

Code: Pascal  [Select][+][-]
  1. procedure TTerminal.feed(s: string);
  2. var
  3.   Info: PWidgetInfo;
  4. begin
  5.   Info := PWidgetInfo(FInfo);
  6.   vte_terminal_feed_child(VTE_TERMINAL(Info.ClientWidget),pchar(s),Length(s));
  7. end;  

Side note: There is typo in TerminalAvaiable in Terminalctrls.pas-file.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Terminal Component Available
« Reply #37 on: December 06, 2019, 06:31:50 pm »
@hunghung

Gnome VTE embedded in Lazarus:

https://forum.lazarus.freepascal.org/index.php?topic=40870.0

Winni

 

TinyPortal © 2005-2018