Boolean operations work only on enclosed areas. If you want to just trim a line, the simplest way for now is to use the I (insert) and B (break) functions with Edit Nodes, then just delete the line segment you don’t want.
For example, if I want to trim the black line to be within the red box:
Select the black line, then click the Edit Nodes button (under the hexagon on the left toolbar):
Zoom in (mouse wheel) to where they cross:
Hover the mouse over the intersection point, hit ‘I’ to insert a point there:
Now, hovering over that point, hit B to break the line at that point. It should un-select it, and now you’ll have two lines, one on either side of the split. Select the one outside the box:
Then hit the Del key to delete it:
We actually have a line trimming function in progress, nearly complete, that will be in the next release that will do all of this automatically, but for the moment this is the easiest way.