The hook in src/plugins/console/public/application/containers/editor/monaco/use_set_initial_value.ts that provides a function for setting the initial value in the Console Monaco editor needs the following improvements:
### Tasks
- [ ] https://github.com/elastic/kibana/issues/179906
- [ ] Replace `window.addEventListener` with a Kibana service (e.g. `history`)
- [ ] Add unit tests for this hook https://github.com/elastic/kibana/pull/196836
The hook in
src/plugins/console/public/application/containers/editor/monaco/use_set_initial_value.ts
that provides a function for setting the initial value in the Console Monaco editor needs the following improvements: