eclipse-cdt / cdt

Eclipse CDT™ C/C++ Development Tools
http://eclipse.org/cdt
Eclipse Public License 2.0
295 stars 192 forks source link

Terminal does not read Eclipse variables used as argument for External Executables #681

Open Mito173 opened 5 months ago

Mito173 commented 5 months ago

Describe the bug Terminal can be configured to execute own commands from context menu 'Show in Local Terminal' on a tree item in the Eclipse Project Explorer tree. Though, the name of selected item cannot be handed over to the called command since the Eclipse variable ${resource_name} is not read.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Preferences->Terminal->Local Termminal'
  2. Click on 'Add...' of panel "Show In ..." Custom Entries'
  3. In Dialog 'Edit External Executable' enter Name: 'Ansible_Playbook' Path: '/usr/local/bin/ansible-playbook' Arguments: '-K ${resource_name}'
  4. Click 'OK'
  5. Click 'Apply and Close'
  6. Select Playbook YAML-file in Project Tree
  7. Right click on file to open context menu
  8. Navigate to 'Show in Local Terminal->Ansible_Playbiook'
  9. Click on 'Ansible_Playbook'
  10. Terminal window opens with error message: 'ERROR! the playbook: ${resource_name} could not be found'

Expected behavior The Ansible Playbook file selected in the Project Explorer tree is executed with the defined command

Screenshots Terminal_Command_01 Terminal_Command_02 Terminal_Command_03

Version Information (please complete the following information): macOS 12.7.2 (Intel) Eclipse IDE for Enterprise Java and Web Developers Version: 2023-12 (4.30.0) Build id: 20231201-2043 Eclipse CDT TM Terminal Control Version: 11.4.0.202311142253 Eclipse CDT Terminal (Console) View Version: 11.4.0.202311142324 Eclipse CDT TM Terminal Version: 11.4.0.202309142347

Additional context Originally I had tried to solve this use-case (Ansible Deployment) by an External Tools Configuration. Running it this way, I will not get an interactive shell, which leads to failure, if an Ansible play expects an input. The custom command feature in the Terminal would be a great solution for this.

microwan commented 4 months ago

Same issue with with Terminal Git Bash. CDT terminal does not take in account my environment variable.