rjkroege / edwood

Go version of Plan9 Acme Editor
Other
387 stars 34 forks source link

Set environment for shell cmd execution #440

Closed dnjp closed 2 years ago

dnjp commented 2 years ago

Environment variables like$samfile, $%, and $winid were not being set when the command was being executed using Hard() (acmeshell not set, command contains $, etc). For example, in acme you can execute echo $winid and see the window id printed in an error window which can be useful in many situations. This PR restores restores that original acme behavior in Edwood.

Adding tests for these cases requires that the Window is available to runproc which the current test suite does not set. Let me know if there is somewhere else this should be tested and I can add test cases for this.

codecov[bot] commented 2 years ago

Codecov Report

Merging #440 (d0593d0) into master (6ebb3f3) will increase coverage by 0.02%. The diff coverage is 54.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #440      +/-   ##
==========================================
+ Coverage   56.89%   56.91%   +0.02%     
==========================================
  Files          54       54              
  Lines       10590    10593       +3     
==========================================
+ Hits         6025     6029       +4     
+ Misses       4138     4136       -2     
- Partials      427      428       +1     
Impacted Files Coverage Δ
exec.go 37.63% <54.54%> (+0.43%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6ebb3f3...d0593d0. Read the comment docs.