MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / focusBlockRun

Function focusBlockRun

cmd/wsh/cmd/wshcmd-focusblock.go:27–51  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

25}
26
27func focusBlockRun(cmd *cobra.Command, args []string) (rtnErr error) {
28 defer func() {
29 sendActivity("focusblock", rtnErr == nil)
30 }()
31
32 tabId := os.Getenv("WAVETERM_TABID")
33 if tabId == "" {
34 return fmt.Errorf("no tab id specified (set WAVETERM_TABID environment variable)")
35 }
36
37 fullORef, err := resolveBlockArg()
38 if err != nil {
39 return err
40 }
41
42 route := fmt.Sprintf("tab:%s", tabId)
43 err = wshclient.SetBlockFocusCommand(RpcClient, fullORef.OID, &wshrpc.RpcOpts{
44 Route: route,
45 Timeout: 2000,
46 })
47 if err != nil {
48 return fmt.Errorf("focusing block: %v", err)
49 }
50 return nil
51}

Callers

nothing calls this directly

Calls 3

SetBlockFocusCommandFunction · 0.92
sendActivityFunction · 0.85
resolveBlockArgFunction · 0.85

Tested by

no test coverage detected