ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/urxvt.pm
(Generate patch)

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.270 by root, Fri Nov 26 18:49:47 2021 UTC vs.
Revision 1.271 by root, Fri Dec 9 05:06:46 2022 UTC

1364Works like the combination of the C<fork>/C<exec> builtins, which executes 1364Works like the combination of the C<fork>/C<exec> builtins, which executes
1365("starts") programs in the background. This function takes care of setting 1365("starts") programs in the background. This function takes care of setting
1366the user environment before exec'ing the command (e.g. C<PATH>) and should 1366the user environment before exec'ing the command (e.g. C<PATH>) and should
1367be preferred over explicit calls to C<exec> or C<system>. 1367be preferred over explicit calls to C<exec> or C<system>.
1368 1368
1369It also sets the C<URXVT_EXT_WINDOWID> environment variable to the window
1370ID of the terminal (C<< $self->parent >>), similar to the C<WINDOWID>
1371variable set for the process spawned inside the terminal.
1372
1369Returns the pid of the subprocess or C<undef> on error. 1373Returns the pid of the subprocess or C<undef> on error.
1370 1374
1371=cut 1375=cut
1372 1376
1373sub exec_async { 1377sub exec_async {
1376 my $pid = fork; 1380 my $pid = fork;
1377 1381
1378 return $pid 1382 return $pid
1379 if !defined $pid or $pid; 1383 if !defined $pid or $pid;
1380 1384
1385 %ENV = (
1381 %ENV = %{ $self->env }; 1386 %{ $self->env },
1387 URXVT_EXT_WINDOWID => $self->parent,
1388 );
1382 1389
1383 exec @_; 1390 exec @_;
1384 urxvt::_exit 255; 1391 urxvt::_exit 255;
1385} 1392}
1386 1393

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines