Skip to content

Commit c5a0b70

Browse files
committed
add basic docs for send function
1 parent 674b8df commit c5a0b70

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ require("nvterm.terminal").new "horizontal"
105105
require("nvterm.terminal").new "vertical"
106106
```
107107

108+
#### Send commands to the terminal
109+
110+
```lua
111+
require("nvterm.terminal").send(" your command ", "horizontal|vertical|float") -- the 2nd argument i.e direction is optional
112+
```
113+
114+
- This function will first open a horizontal terminal and then run the `node test.js` command
115+
- Whenever you re-run this function, it'll just run that command in that horizontal terminal.
116+
```lua
117+
function()
118+
require("nvterm.terminal").send("node test.js", "horizontal")
119+
end,
120+
```
121+
108122
### Additional Functionality
109123

110124
NvTerm provides an api for you to send commands to the terminal. You can create different ones for different filetypes like so:

0 commit comments

Comments
 (0)